summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/EventLoop')
-rw-r--r--Swiften/EventLoop/EventLoop.cpp5
-rw-r--r--Swiften/EventLoop/EventLoop.h5
2 files changed, 4 insertions, 6 deletions
diff --git a/Swiften/EventLoop/EventLoop.cpp b/Swiften/EventLoop/EventLoop.cpp
index afb6858..0f78d96 100644
--- a/Swiften/EventLoop/EventLoop.cpp
+++ b/Swiften/EventLoop/EventLoop.cpp
@@ -12,7 +12,10 @@
#include <cassert>
#include <Swiften/Base/Log.h>
+#include <boost/lambda/lambda.hpp>
+#include <boost/lambda/bind.hpp>
+namespace lambda = boost::lambda;
namespace Swift {
@@ -83,7 +86,7 @@ void EventLoop::postEvent(boost::function<void ()> callback, boost::shared_ptr<E
void EventLoop::removeEventsFromOwner(boost::shared_ptr<EventOwner> owner) {
boost::lock_guard<boost::mutex> lock(eventsMutex_);
- events_.remove_if(HasOwner(owner));
+ events_.remove_if(lambda::bind(&Event::owner, lambda::_1) == owner);
}
}
diff --git a/Swiften/EventLoop/EventLoop.h b/Swiften/EventLoop/EventLoop.h
index 4a602ae..587ba22 100644
--- a/Swiften/EventLoop/EventLoop.h
+++ b/Swiften/EventLoop/EventLoop.h
@@ -35,11 +35,6 @@ namespace Swift {
void handleEvent(const Event& event);
private:
- struct HasOwner {
- HasOwner(boost::shared_ptr<EventOwner> owner) : owner(owner) {}
- bool operator()(const Event& event) const { return event.owner == owner; }
- boost::shared_ptr<EventOwner> owner;
- };
boost::mutex eventsMutex_;
unsigned int nextEventID_;
std::list<Event> events_;