summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/EventLoop/EventLoop.cpp3
-rw-r--r--Swiften/EventLoop/Qt/QtEventLoop.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/EventLoop/EventLoop.cpp b/Swiften/EventLoop/EventLoop.cpp
index c6d42d8..69d8abe 100644
--- a/Swiften/EventLoop/EventLoop.cpp
+++ b/Swiften/EventLoop/EventLoop.cpp
@@ -21,6 +21,8 @@ EventLoop::~EventLoop() {
}
void EventLoop::handleEvent(const Event& event) {
+ //SWIFT_LOG(debug) << "Handling event " << event.id << std::endl;
+
if (handlingEvents_) {
// We're being called recursively. Push in the list of events to
// handle in the parent handleEvent()
@@ -70,6 +72,7 @@ void EventLoop::postEvent(boost::function<void ()> callback, boost::shared_ptr<E
nextEventID_++;
events_.push_back(event);
}
+ //SWIFT_LOG(debug) << "Posting event " << event.id << std::endl;
post(event);
}
diff --git a/Swiften/EventLoop/Qt/QtEventLoop.h b/Swiften/EventLoop/Qt/QtEventLoop.h
index 258a920..b42b916 100644
--- a/Swiften/EventLoop/Qt/QtEventLoop.h
+++ b/Swiften/EventLoop/Qt/QtEventLoop.h
@@ -15,6 +15,9 @@
class QtEventLoop : public QObject, public Swift::EventLoop {
public:
QtEventLoop() {}
+ ~QtEventLoop() {
+ QCoreApplication::removePostedEvents(this);
+ }
virtual void post(const Swift::Event& event) {
QCoreApplication::postEvent(this, new Event(event));