handle AudioInjectorManager cleanup in Application

This commit is contained in:
Stephen Birarda 2015-11-17 16:39:23 -08:00
parent ab5c8e072f
commit 935c0cc137
2 changed files with 10 additions and 0 deletions

View file

@ -863,6 +863,10 @@ void Application::cleanupBeforeQuit() {
// destroy the AudioClient so it and its thread have a chance to go down safely
DependencyManager::destroy<AudioClient>();
// destroy the AudioInjectorManager so it and its thread have a chance to go down safely
// this will also stop any ongoing network injectors
DependencyManager::destroy<AudioInjectorManager>();
// Destroy third party processes after scripts have finished using them.
#ifdef HAVE_DDE

View file

@ -34,6 +34,12 @@ AudioInjectorManager::~AudioInjectorManager() {
_injectors.pop();
}
// get rid of the lock now that we've stopped all living injectors
lock.unlock();
// in case the thread is waiting for injectors wake it up now
_injectorReady.notify_one();
// quit and wait on the manager thread, if we ever created it
if (_thread) {
_thread->quit();