summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/XMPPEvents')
-rw-r--r--Swift/Controllers/XMPPEvents/EventController.cpp1
-rw-r--r--Swift/Controllers/XMPPEvents/EventController.h2
-rw-r--r--Swift/Controllers/XMPPEvents/StanzaEvent.h3
3 files changed, 4 insertions, 2 deletions
diff --git a/Swift/Controllers/XMPPEvents/EventController.cpp b/Swift/Controllers/XMPPEvents/EventController.cpp
index 4e70978..381a5a1 100644
--- a/Swift/Controllers/XMPPEvents/EventController.cpp
+++ b/Swift/Controllers/XMPPEvents/EventController.cpp
@@ -31,6 +31,7 @@ void EventController::handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceE
}
void EventController::handleEventConcluded(boost::shared_ptr<StanzaEvent> event) {
+ event->onConclusion.disconnect(boost::bind(&EventController::handleEventConcluded, this, event));
events_.erase(std::remove(events_.begin(), events_.end(), event), events_.end());
onEventQueueLengthChange(events_.size());
}
diff --git a/Swift/Controllers/XMPPEvents/EventController.h b/Swift/Controllers/XMPPEvents/EventController.h
index ba571df..61c5c47 100644
--- a/Swift/Controllers/XMPPEvents/EventController.h
+++ b/Swift/Controllers/XMPPEvents/EventController.h
@@ -17,7 +17,7 @@
namespace Swift {
typedef std::vector<boost::shared_ptr<StanzaEvent> > EventList;
- class EventController {
+ class EventController : public boost::bsignals::trackable{
public:
EventController();
diff --git a/Swift/Controllers/XMPPEvents/StanzaEvent.h b/Swift/Controllers/XMPPEvents/StanzaEvent.h
index 78dd4dc..321d23d 100644
--- a/Swift/Controllers/XMPPEvents/StanzaEvent.h
+++ b/Swift/Controllers/XMPPEvents/StanzaEvent.h
@@ -17,7 +17,8 @@ namespace Swift {
StanzaEvent() : time_(boost::posix_time::microsec_clock::universal_time()) {concluded_ = false;};
virtual ~StanzaEvent() {};
void conclude() {concluded_ = true; onConclusion();};
- /** Do not call this directly from outside the class */
+ /** Do not call this directly from outside the class.
+ * If you connect to this signal, you *must* disconnect from it manually. */
boost::signal<void()> onConclusion;
bool getConcluded() {return concluded_;};
boost::posix_time::ptime getTime() {return time_;}