improve cleanup of VCA related objects
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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 ();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user