summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-12-08 23:39:50 +0100
committerRobin Gareus <robin@gareus.org>2018-12-08 23:39:50 +0100
commit2dc3c8b3650266eba09cf7fe53c39c6728d4d5b6 (patch)
treeeae6b773692ed2b97ea9543c135415ad11d71e8c
parent9004a0df7ae4d81fd6e08231e2fd896b082f3cfb (diff)
Better version of 9ccc56e1625, implicit signal disconnect
-rw-r--r--gtk2_ardour/option_editor.cc7
-rw-r--r--gtk2_ardour/option_editor.h6
2 files changed, 2 insertions, 11 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc
index 3482f66980..c930254cbe 100644
--- a/gtk2_ardour/option_editor.cc
+++ b/gtk2_ardour/option_editor.cc
@@ -220,17 +220,12 @@ CheckOption::CheckOption (string const & i, string const & n, Glib::RefPtr<Gtk::
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
if (tact) {
action_toggled ();
- _callback_connection = tact->signal_toggled().connect (sigc::mem_fun (*this, &CheckOption::action_toggled));
+ tact->signal_toggled().connect (sigc::mem_fun (*this, &CheckOption::action_toggled));
}
_action->connect_property_changed ("sensitive", sigc::mem_fun (*this, &CheckOption::action_sensitivity_changed));
}
-CheckOption::~CheckOption ()
-{
- _callback_connection.disconnect ();
-}
-
void
CheckOption::action_toggled ()
{
diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h
index 749df8f90c..ca88dbf07b 100644
--- a/gtk2_ardour/option_editor.h
+++ b/gtk2_ardour/option_editor.h
@@ -189,11 +189,10 @@ protected:
};
/** Just a Gtk Checkbutton, masquerading as an option component */
-class CheckOption : public OptionEditorComponent , public Gtkmm2ext::Activatable
+class CheckOption : public OptionEditorComponent , public Gtkmm2ext::Activatable, public sigc::trackable
{
public:
CheckOption (std::string const &, std::string const &, Glib::RefPtr<Gtk::Action> act );
- virtual ~CheckOption ();
void set_state_from_config () {}
void parameter_changed (std::string const &) {}
void add_to_page (OptionEditorPage*);
@@ -213,9 +212,6 @@ protected:
Gtk::CheckButton* _button; ///< UI button
Gtk::Label* _label; ///< label for button, so we can use markup
-
-private:
- sigc::connection _callback_connection;
};
/** Component which provides the UI to handle a boolean option using a GTK CheckButton */