summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libs/gui/ControlGroups.cpp10
-rw-r--r--src/libs/gui/ControlGroups.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/src/libs/gui/ControlGroups.cpp b/src/libs/gui/ControlGroups.cpp
index 14d67870..5098c3f8 100644
--- a/src/libs/gui/ControlGroups.cpp
+++ b/src/libs/gui/ControlGroups.cpp
@@ -43,6 +43,14 @@ ControlGroup::ControlGroup(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl
_enable_signal(false)
{
}
+
+
+ControlGroup::~ControlGroup()
+{
+ _enable_signal = false;
+ _control_connection.disconnect();
+ _port_model.reset();
+}
void
@@ -54,7 +62,7 @@ ControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm)
assert(_port_model);
assert(panel);
- pm->control_change_sig.connect(sigc::mem_fun(this, &ControlGroup::set_value));
+ _control_connection = pm->control_change_sig.connect(sigc::mem_fun(this, &ControlGroup::set_value));
}
diff --git a/src/libs/gui/ControlGroups.h b/src/libs/gui/ControlGroups.h
index 4a1f758e..4c5c6f11 100644
--- a/src/libs/gui/ControlGroups.h
+++ b/src/libs/gui/ControlGroups.h
@@ -43,7 +43,7 @@ class ControlGroup : public Gtk::VBox
{
public:
ControlGroup(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml);
- virtual ~ControlGroup() { }
+ virtual ~ControlGroup();
void init(ControlPanel* panel, SharedPtr<PortModel> pm);
@@ -57,6 +57,7 @@ protected:
ControlPanel* _control_panel;
SharedPtr<PortModel> _port_model;
+ sigc::connection _control_connection;
bool _enable_signal;
};