diff options
-rw-r--r-- | Swift/Controllers/XMPPEvents/EventController.cpp | 6 | ||||
-rw-r--r-- | Swift/Controllers/XMPPEvents/EventController.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Swift/Controllers/XMPPEvents/EventController.cpp b/Swift/Controllers/XMPPEvents/EventController.cpp index 381a5a1..f2fdcfe 100644 --- a/Swift/Controllers/XMPPEvents/EventController.cpp +++ b/Swift/Controllers/XMPPEvents/EventController.cpp @@ -18,6 +18,12 @@ namespace Swift { EventController::EventController() { } +EventController::~EventController() { + foreach(boost::shared_ptr<StanzaEvent> event, events_) { + event->onConclusion.disconnect(boost::bind(&EventController::handleEventConcluded, this, event)); + } +} + void EventController::handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceEvent) { boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(sourceEvent); boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(sourceEvent); diff --git a/Swift/Controllers/XMPPEvents/EventController.h b/Swift/Controllers/XMPPEvents/EventController.h index 61c5c47..1e0a069 100644 --- a/Swift/Controllers/XMPPEvents/EventController.h +++ b/Swift/Controllers/XMPPEvents/EventController.h @@ -17,10 +17,12 @@ namespace Swift { typedef std::vector<boost::shared_ptr<StanzaEvent> > EventList; - class EventController : public boost::bsignals::trackable{ + class EventController { public: EventController(); + ~EventController(); + void handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceEvent); boost::signal<void (int)> onEventQueueLengthChange; boost::signal<void (boost::shared_ptr<StanzaEvent>)> onEventQueueEventAdded; |