use AudioEngine destructor to do necessary stuff when shutting it down, and remove unused Config stuff in AudioEngine
This commit is contained in:
parent
f1b2674d9b
commit
da7d3afc87
@ -229,6 +229,7 @@ public:
|
||||
std::string _latency_output_name;
|
||||
framecnt_t _latency_signal_latency;
|
||||
bool _started_for_latency;
|
||||
bool _in_destructor;
|
||||
|
||||
void meter_thread ();
|
||||
void start_metering_thread ();
|
||||
@ -236,9 +237,6 @@ public:
|
||||
|
||||
static gint m_meter_exit;
|
||||
|
||||
void parameter_changed (const std::string&);
|
||||
PBD::ScopedConnection config_connection;
|
||||
|
||||
typedef std::map<std::string,AudioBackendInfo*> BackendMap;
|
||||
BackendMap _backends;
|
||||
AudioBackendInfo* backend_discover (const std::string&);
|
||||
|
@ -81,6 +81,7 @@ AudioEngine::AudioEngine ()
|
||||
, _latency_flush_frames (0)
|
||||
, _latency_signal_latency (0)
|
||||
, _started_for_latency (false)
|
||||
, _in_destructor (false)
|
||||
{
|
||||
g_atomic_int_set (&m_meter_exit, 0);
|
||||
discover_backends ();
|
||||
@ -88,15 +89,9 @@ AudioEngine::AudioEngine ()
|
||||
|
||||
AudioEngine::~AudioEngine ()
|
||||
{
|
||||
_in_destructor = true;
|
||||
stop_metering_thread ();
|
||||
drop_backend ();
|
||||
|
||||
config_connection.disconnect ();
|
||||
|
||||
{
|
||||
Glib::Threads::Mutex::Lock tm (_process_lock);
|
||||
session_removed.signal ();
|
||||
stop_metering_thread ();
|
||||
}
|
||||
}
|
||||
|
||||
AudioEngine*
|
||||
@ -1000,6 +995,11 @@ AudioEngine::update_latencies ()
|
||||
void
|
||||
AudioEngine::halted_callback (const char* why)
|
||||
{
|
||||
if (_in_destructor) {
|
||||
/* everything is under control */
|
||||
return;
|
||||
}
|
||||
|
||||
stop_metering_thread ();
|
||||
_running = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user