From 06eb154db25ea003a944db682de8cad4668b8375 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 21 Feb 2022 13:28:17 -0700 Subject: [PATCH] derive TriggerUI from sigc::trackable so that it can be automically disconnected from signals Note: this still seems suspicious: we explicitly disconnected from signals in the destructor. However, it is better form to be able to use invalidator() in the connection call --- gtk2_ardour/trigger_ui.cc | 4 ++-- gtk2_ardour/trigger_ui.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/trigger_ui.cc b/gtk2_ardour/trigger_ui.cc index 82ade283a1..c52d30bbbd 100644 --- a/gtk2_ardour/trigger_ui.cc +++ b/gtk2_ardour/trigger_ui.cc @@ -132,8 +132,8 @@ TriggerUI::trigger_swap (uint32_t n) } trigger_connections.drop_connections (); - trigger()->PropertyChanged.connect (trigger_connections, MISSING_INVALIDATOR, boost::bind (&TriggerUI::trigger_changed, this, _1), gui_context ()); - tref.box->PropertyChanged.connect (trigger_connections, MISSING_INVALIDATOR, boost::bind (&TriggerUI::trigger_changed, this, _1), gui_context ()); + trigger()->PropertyChanged.connect (trigger_connections, invalidator (*this), boost::bind (&TriggerUI::trigger_changed, this, _1), gui_context ()); + tref.box->PropertyChanged.connect (trigger_connections, invalidator (*this), boost::bind (&TriggerUI::trigger_changed, this, _1), gui_context ()); trigger_changed (Properties::name); } diff --git a/gtk2_ardour/trigger_ui.h b/gtk2_ardour/trigger_ui.h index dc2bcbae10..bf62bb1f24 100644 --- a/gtk2_ardour/trigger_ui.h +++ b/gtk2_ardour/trigger_ui.h @@ -37,7 +37,7 @@ namespace Gtk class TriggerJumpDialog; -class TriggerUI +class TriggerUI : virtual public sigc::trackable { public: TriggerUI ();