Clean up TMM at exit

This commit is contained in:
Robin Gareus 2020-10-19 16:37:30 +02:00
parent f3fbb96d6a
commit 8bc3e86066
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
3 changed files with 12 additions and 1 deletions

View file

@ -41,6 +41,7 @@ class LIBARDOUR_API TransportMasterManager : public boost::noncopyable
void engine_stopped ();
static TransportMasterManager& instance();
static void destroy();
/* this method is not thread-safe and is intended to be used only
* very early in application-lifetime to check if the TMM has
* been created yet. Do not use in other code.

View file

@ -654,6 +654,7 @@ ARDOUR::cleanup ()
delete &ControlProtocolManager::instance ();
ARDOUR::AudioEngine::destroy ();
ARDOUR::TransportMasterManager::destroy ();
delete Library;
#ifdef HAVE_LRDF

View file

@ -47,7 +47,9 @@ TransportMasterManager::TransportMasterManager()
TransportMasterManager::~TransportMasterManager ()
{
clear ();
Glib::Threads::RWLock::WriterLock lm (lock);
_current_master.reset ();
_transport_masters.clear ();
}
TransportMasterManager&
@ -139,6 +141,13 @@ TransportMasterManager::instance()
return *_instance;
}
void
TransportMasterManager::destroy()
{
delete _instance;
_instance = 0;
}
// Called from AudioEngine::process_callback() BEFORE Session::process() is called. Each transport master has processed any incoming data for this cycle,
// and this method computes the transport speed that Ardour should use to get into and remain in sync with the master.
//