summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/Roster/QtFilterWidget.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Swift/QtUI/Roster/QtFilterWidget.cpp b/Swift/QtUI/Roster/QtFilterWidget.cpp
index a52dfff..2f561bd 100644
--- a/Swift/QtUI/Roster/QtFilterWidget.cpp
+++ b/Swift/QtUI/Roster/QtFilterWidget.cpp
@@ -49,7 +49,13 @@ QtFilterWidget::QtFilterWidget(QWidget* parent, QtTreeWidget* treeView, UIEventS
QtFilterWidget::~QtFilterWidget() {
filterLineEdit_->removeEventFilter(this);
- treeView_->removeEventFilter(this);
+ if (treeView_) {
+ treeView_->removeEventFilter(this);
+ if (treeView_->getRoster()) {
+ treeView_->getRoster()->onFilterAdded.disconnect(boost::bind(&QtFilterWidget::handleFilterAdded, this, _1));
+ treeView_->getRoster()->onFilterRemoved.disconnect(boost::bind(&QtFilterWidget::handleFilterRemoved, this, _1));
+ }
+ }
}
bool QtFilterWidget::eventFilter(QObject*, QEvent* event) {