summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-01-22 12:26:37 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-01-22 12:26:37 (GMT)
commit1aaadc84dd9a34a5df6b9dbef867bdaa46d07a30 (patch)
tree7ebf7566b7d53a5b7249370a3141cce30c5ac819 /Swiften
parent81db7d1ca46b7b0d922a1107d93f49b2cebb6bfb (diff)
downloadswift-1aaadc84dd9a34a5df6b9dbef867bdaa46d07a30.zip
swift-1aaadc84dd9a34a5df6b9dbef867bdaa46d07a30.tar.bz2
Some small event loop tweaks.
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));