summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/Controllers/BlockListController.cpp3
-rw-r--r--Swift/Controllers/BlockListController.h1
-rw-r--r--Swift/Controllers/MainController.cpp2
3 files changed, 5 insertions, 1 deletions
diff --git a/Swift/Controllers/BlockListController.cpp b/Swift/Controllers/BlockListController.cpp
index 6bdb513..d778883 100644
--- a/Swift/Controllers/BlockListController.cpp
+++ b/Swift/Controllers/BlockListController.cpp
@@ -21,13 +21,14 @@
namespace Swift {
-BlockListController::BlockListController(ClientBlockListManager* blockListManager, UIEventStream* uiEventStream, BlockListEditorWidgetFactory* blockListEditorWidgetFactory, EventController* eventController) : blockListManager_(blockListManager), blockListEditorWidgetFactory_(blockListEditorWidgetFactory), blockListEditorWidget_(0), eventController_(eventController), remainingRequests_(0) {
+BlockListController::BlockListController(ClientBlockListManager* blockListManager, UIEventStream* uiEventStream, BlockListEditorWidgetFactory* blockListEditorWidgetFactory, EventController* eventController) : blockListManager_(blockListManager), blockListEditorWidgetFactory_(blockListEditorWidgetFactory), blockListEditorWidget_(0), eventController_(eventController), remainingRequests_(0), uiEventStream_(uiEventStream) {
uiEventStream->onUIEvent.connect(boost::bind(&BlockListController::handleUIEvent, this, _1));
blockListManager_->getBlockList()->onItemAdded.connect(boost::bind(&BlockListController::handleBlockListChanged, this));
blockListManager_->getBlockList()->onItemRemoved.connect(boost::bind(&BlockListController::handleBlockListChanged, this));
}
BlockListController::~BlockListController() {
+ uiEventStream_->onUIEvent.disconnect(boost::bind(&BlockListController::handleUIEvent, this, _1));
blockListManager_->getBlockList()->onItemAdded.disconnect(boost::bind(&BlockListController::handleBlockListChanged, this));
blockListManager_->getBlockList()->onItemRemoved.disconnect(boost::bind(&BlockListController::handleBlockListChanged, this));
}
diff --git a/Swift/Controllers/BlockListController.h b/Swift/Controllers/BlockListController.h
index 4c9caad..99c143c 100644
--- a/Swift/Controllers/BlockListController.h
+++ b/Swift/Controllers/BlockListController.h
@@ -43,6 +43,7 @@ private:
EventController* eventController_;
std::vector<JID> blockListBeforeEdit;
int remainingRequests_;
+ UIEventStream* uiEventStream_;
};
}
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index a16cbe7..95d8134 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -262,6 +262,8 @@ void MainController::resetClient() {
#endif
delete ftOverview_;
ftOverview_ = NULL;
+ delete blockListController_;
+ blockListController_ = NULL;
delete rosterController_;
rosterController_ = NULL;
delete eventNotifier_;