improved port cleanup as backend is destroyed

This commit is contained in:
Paul Davis 2020-04-07 23:26:51 -06:00
parent ec9784764c
commit 78a66b7180
5 changed files with 10 additions and 0 deletions

View File

@ -89,6 +89,8 @@ AlsaAudioBackend::AlsaAudioBackend (AudioEngine& e, AudioBackendInfo& info)
AlsaAudioBackend::~AlsaAudioBackend ()
{
clear_ports ();
pthread_mutex_destroy (&_port_callback_mutex);
pthread_mutex_destroy (&_device_port_mutex);
}

View File

@ -129,6 +129,9 @@ CoreAudioBackend::~CoreAudioBackend ()
{
delete _pcmio; _pcmio = 0;
delete _midiio; _midiio = 0;
clear_ports ();
pthread_mutex_destroy (&_port_callback_mutex);
pthread_mutex_destroy (&_port_registration_mutex);
pthread_mutex_destroy (&_process_callback_mutex);

View File

@ -72,6 +72,7 @@ JACKAudioBackend::JACKAudioBackend (AudioEngine& e, AudioBackendInfo& info, boos
JACKAudioBackend::~JACKAudioBackend()
{
_jack_ports.clear ();
}
string

View File

@ -106,6 +106,8 @@ PortAudioBackend::~PortAudioBackend ()
delete _pcmio; _pcmio = 0;
delete _midiio; _midiio = 0;
clear_ports ();
pthread_mutex_destroy (&_port_callback_mutex);
pthread_mutex_destroy (&_freewheel_mutex);
pthread_cond_destroy (&_freewheel_signal);

View File

@ -69,6 +69,8 @@ PulseAudioBackend::PulseAudioBackend (AudioEngine& e, AudioBackendInfo& info)
PulseAudioBackend::~PulseAudioBackend ()
{
clear_ports ();
pthread_mutex_destroy (&_port_callback_mutex);
}