diff options
author | Robin Gareus <robin@gareus.org> | 2018-12-08 21:18:54 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-12-08 21:18:54 +0100 |
commit | 9ccc56e162554c292b25408246e3680b8f14eea7 (patch) | |
tree | 0d30b6978eb59494e1faaaa794300f336e44e8dd /gtk2_ardour/option_editor.h | |
parent | 474d68c05132291fd8eb200006e7e63aebefdc8d (diff) |
Fix CheckOption crash on session-reload
The ToggleAction has a lifetime of the UI, independent of the
CheckOption widget. The CheckOption needs to unsubscribe from the
signal_toggled() signal when it is deleted.
Also a CheckOption without a Action makes no sense. require _action
to be give at instantiation time.
Diffstat (limited to 'gtk2_ardour/option_editor.h')
-rw-r--r-- | gtk2_ardour/option_editor.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h index d6738889f3..749df8f90c 100644 --- a/gtk2_ardour/option_editor.h +++ b/gtk2_ardour/option_editor.h @@ -193,6 +193,7 @@ class CheckOption : public OptionEditorComponent , public Gtkmm2ext::Activatable { 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*); @@ -203,17 +204,18 @@ public: Gtk::Widget& tip_widget() { return *_button; } +protected: void action_toggled (); void action_sensitivity_changed () {} void action_visibility_changed () {} -protected: virtual void toggled (); - sigc::slot<bool> _get; ///< slot to get the configuration variable's value - sigc::slot<bool, bool> _set; ///< slot to set the configuration variable's value 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 */ |