summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-24 02:05:09 +0000
committerDavid Robillard <d@drobilla.net>2007-07-24 02:05:09 +0000
commitdb1861e76aa1a42789c78f37f110cc81c0339a2d (patch)
treeb5fdb57933d628789f5711a48d442019ef0c8bbb /src/libs
parent5c0d12b6a96e1a0468f81ee14e6440f4f6d570bb (diff)
downloadingen-db1861e76aa1a42789c78f37f110cc81c0339a2d.tar.gz
ingen-db1861e76aa1a42789c78f37f110cc81c0339a2d.tar.bz2
ingen-db1861e76aa1a42789c78f37f110cc81c0339a2d.zip
Fix crash triggered by closing controls window (twice, sometimes).
git-svn-id: http://svn.drobilla.net/lad/ingen@608 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs')
-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;
};