diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-10-07 18:35:10 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-10-07 18:35:10 (GMT) |
commit | e433e70d3dd015db5124ee72085e758635260168 (patch) | |
tree | 1d5d151deb2e474b841bbf9c92eeaa3690cd86d4 /Swiften/EventLoop/EventLoop.h | |
parent | 83c5c774b9e71133401e574b1ca7fc6d766bc492 (diff) | |
download | swift-contrib-e433e70d3dd015db5124ee72085e758635260168.zip swift-contrib-e433e70d3dd015db5124ee72085e758635260168.tar.bz2 |
Avoid recursive calling of event callbacks.
When EventLoop::handleEvent() was called recursively (i.e. by calling
processEvents() from a slot), weird things happened, especially in the
XMPP parser (assertion triggers, parse error from server, ...). Now, callbacks
are put in a queue handled by the topmost handleEvent.
Resolves: #592, #568
Diffstat (limited to 'Swiften/EventLoop/EventLoop.h')
-rw-r--r-- | Swiften/EventLoop/EventLoop.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Swiften/EventLoop/EventLoop.h b/Swiften/EventLoop/EventLoop.h index efc68ea..ab58ffc 100644 --- a/Swiften/EventLoop/EventLoop.h +++ b/Swiften/EventLoop/EventLoop.h @@ -9,6 +9,7 @@ #include <boost/function.hpp> #include <boost/thread/mutex.hpp> #include <list> +#include <deque> #include "Swiften/EventLoop/Event.h" @@ -40,5 +41,7 @@ namespace Swift { boost::mutex eventsMutex_; unsigned int nextEventID_; std::list<Event> events_; + bool handlingEvents_; + std::deque<Event> eventsToHandle_; }; } |