summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2017-05-15 14:33:07 (GMT)
committerTobias Markmann <tm@ayena.de>2017-05-15 14:35:09 (GMT)
commit6644c207c879f33dac40c02ab6787a0c4184728d (patch)
treec0ed8dd127185a5fe74d363fedfdd98113a66fdd /Swift/QtUI
parent33f9a7682a9b40d141900aa7ce302a8e47d4d762 (diff)
downloadswift-6644c207c879f33dac40c02ab6787a0c4184728d.zip
swift-6644c207c879f33dac40c02ab6787a0c4184728d.tar.bz2
Disconnect potentially connected slots from signals in dtor
SWIFT-247 Test-Information: Tests pass and builds on macOS 10.12.4 with Qt 5.4.2. Change-Id: I39b62f53c62fba972e6a29e89cd00fb3b4e1a5b5
Diffstat (limited to 'Swift/QtUI')
-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) {