Better version of 9ccc56e162, implicit signal disconnect

This commit is contained in:
Robin Gareus 2018-12-08 23:39:50 +01:00
parent 9004a0df7a
commit 2dc3c8b365
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 2 additions and 11 deletions

View file

@ -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 ()
{