Commit 55e9e8e6 authored by CABEL Tristan's avatar CABEL Tristan

bugfix explicitely delete the connection on destruction

parent c7180208
......@@ -239,7 +239,7 @@ dtkWidgetsMenuItemParameterFacade::dtkWidgetsMenuItemParameterFacade(dtkWidgetsM
this->hide();
}
connect(source->parameter(), &dtkCoreParameter::advancedChanged, [=] (bool advanced) {
this->param_connect = connect(source->parameter(), &dtkCoreParameter::advancedChanged, [this] (bool advanced) {
if(advanced)
this->hide();
else
......@@ -251,6 +251,7 @@ dtkWidgetsMenuItemParameterFacade::dtkWidgetsMenuItemParameterFacade(dtkWidgetsM
dtkWidgetsMenuItemParameterFacade::~dtkWidgetsMenuItemParameterFacade(void)
{
QObject::disconnect(this->param_connect);
this->layout()->itemAt(1)->widget()->setParent(nullptr);
}
......
......@@ -178,6 +178,9 @@ class dtkWidgetsMenuItemParameterFacade : public dtkWidgetsMenuItemFacade
public:
dtkWidgetsMenuItemParameterFacade(dtkWidgetsMenuItemParameter *source, QWidget *parent = nullptr);
~dtkWidgetsMenuItemParameterFacade(void);
private:
QMetaObject::Connection param_connect;
};
// ///////////////////////////////////////////////////////////////////
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment