13
0

amend 7c7bf6c88b, do not notify UI during cleanup

This fixes a rare crash where the signal causes a
cxa_pure_virtual in PBD::Signal1 during destruction.
This commit is contained in:
Robin Gareus 2023-06-09 16:17:22 +02:00
parent ad49de022a
commit 55afdc2aa4
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 6 additions and 4 deletions

View File

@ -52,7 +52,7 @@ class LIBARDOUR_API TransportMasterManager : public boost::noncopyable
int add (SyncSource type, std::string const & name, bool removeable = true);
int remove (std::string const & name);
void clear ();
void clear (bool emit = true);
PBD::Signal1<void,std::shared_ptr<TransportMaster> > Added;
PBD::Signal1<void,std::shared_ptr<TransportMaster> > Removed; // null argument means "clear"

View File

@ -754,7 +754,7 @@ ARDOUR::cleanup ()
engine_startup_connection.disconnect ();
delete &ControlProtocolManager::instance ();
ARDOUR::TransportMasterManager::instance ().clear ();
ARDOUR::TransportMasterManager::instance ().clear (false);
ARDOUR::AudioEngine::destroy ();
ARDOUR::TransportMasterManager::destroy ();

View File

@ -582,7 +582,7 @@ TransportMasterManager::set_current (std::string const & str)
void
TransportMasterManager::clear ()
TransportMasterManager::clear (bool emit)
{
{
Glib::Threads::RWLock::WriterLock lm (lock);
@ -590,7 +590,9 @@ TransportMasterManager::clear ()
_transport_masters.clear ();
}
Removed (std::shared_ptr<TransportMaster>());
if (emit) {
Removed (std::shared_ptr<TransportMaster>());
}
}
int