From be4e898996837f718627c34d62dd42e6825103b7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 23 Apr 2016 18:25:32 -0400 Subject: improve cleanup of VCA related objects --- libs/ardour/route.cc | 2 ++ libs/ardour/slavable_automation_control.cc | 3 ++- libs/ardour/vca_manager.cc | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 64f8764303..78e0228382 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -5442,6 +5442,8 @@ Route::slaved_to (boost::shared_ptr vca) const return false; } + /* just test one particular control, not all of them */ + return _gain_control->slaved_to (vca->gain_control()); } diff --git a/libs/ardour/slavable_automation_control.cc b/libs/ardour/slavable_automation_control.cc index 8c50863d95..71769ad155 100644 --- a/libs/ardour/slavable_automation_control.cc +++ b/libs/ardour/slavable_automation_control.cc @@ -139,7 +139,7 @@ SlavableAutomationControl::add_master (boost::shared_ptr m) itself. */ - m->DropReferences.connect_same_thread (masters_connections, boost::bind (&SlavableAutomationControl::master_going_away, this, m)); + m->DropReferences.connect_same_thread (masters_connections, boost::bind (&SlavableAutomationControl::master_going_away, this, boost::weak_ptr(m))); /* Store the connection inside the MasterRecord, so that when we destroy it, the connection is destroyed and we no longer hear about changes to the AutomationControl. @@ -242,6 +242,7 @@ SlavableAutomationControl::remove_master (boost::shared_ptr m pre_remove_master (m); + { Glib::Threads::RWLock::WriterLock lm (master_lock); current_value = get_value_locked (); diff --git a/libs/ardour/vca_manager.cc b/libs/ardour/vca_manager.cc index d7ad6ea851..e0d7e0fc82 100644 --- a/libs/ardour/vca_manager.cc +++ b/libs/ardour/vca_manager.cc @@ -48,6 +48,9 @@ void VCAManager::clear () { Mutex::Lock lm (lock); + for (VCAList::const_iterator i = _vcas.begin(); i != _vcas.end(); ++i) { + (*i)->DropReferences (); + } _vcas.clear (); } -- cgit v1.2.3