mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 16:02:08 +02:00
Guard for AudioInjectorManager existance; clear an audio interface pointer
This commit is contained in:
parent
8b2c935f92
commit
53cf915e8d
2 changed files with 7 additions and 2 deletions
|
@ -2824,6 +2824,7 @@ void Application::cleanupBeforeQuit() {
|
|||
|
||||
// destroy Audio so it and its threads have a chance to go down safely
|
||||
// this must happen after QML, as there are unexplained audio crashes originating in qtwebengine
|
||||
AudioInjector::setLocalAudioInterface(nullptr);
|
||||
DependencyManager::destroy<AudioClient>();
|
||||
DependencyManager::destroy<AudioScriptingInterface>();
|
||||
|
||||
|
|
|
@ -33,5 +33,9 @@ ScriptAudioInjector::ScriptAudioInjector(const AudioInjectorPointer& injector) :
|
|||
}
|
||||
|
||||
ScriptAudioInjector::~ScriptAudioInjector() {
|
||||
DependencyManager::get<AudioInjectorManager>()->stop(_injector);
|
||||
}
|
||||
const auto audioInjectorManager = DependencyManager::get<AudioInjectorManager>();
|
||||
// AudioInjectorManager may have been destroyed on application shutdown.
|
||||
if (audioInjectorManager) {
|
||||
audioInjectorManager->stop(_injector);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue