summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-04-23 18:25:32 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:41 -0400
commitbe4e898996837f718627c34d62dd42e6825103b7 (patch)
tree1f1a531c0b65fb35a2cb9c2e30c33653a0859239 /libs
parent51064f77a874f15c2cebd4fed12996177f951936 (diff)
improve cleanup of VCA related objects
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/route.cc2
-rw-r--r--libs/ardour/slavable_automation_control.cc3
-rw-r--r--libs/ardour/vca_manager.cc3
3 files changed, 7 insertions, 1 deletions
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> 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<AutomationControl> 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<AutomationControl>(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<AutomationControl> 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 ();
}