diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 299417fdb9..0e4da4b158 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1780,18 +1780,20 @@ void Application::cleanupBeforeQuit() { // stop QML DependencyManager::destroy(); + delete _snapshotSoundInjector; + _snapshotSoundInjector = nullptr; + // stop audio after QML, as there are unexplained audio crashes originating in qtwebengine // stop the AudioClient, synchronously QMetaObject::invokeMethod(DependencyManager::get().data(), "stop", Qt::BlockingQueuedConnection); + // destroy Audio so it and its threads have a chance to go down safely DependencyManager::destroy(); DependencyManager::destroy(); -// delete _snapshotSound; -// _snapshotSound = nullptr; qCDebug(interfaceapp) << "Application::cleanupBeforeQuit() complete"; } diff --git a/interface/src/Application.h b/interface/src/Application.h index 80bc5e2a7f..dff1de2860 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -685,7 +685,7 @@ private: QTimer _addAssetToWorldErrorTimer; FileScriptingInterface* _fileDownload; - AudioInjector* _snapshotSoundInjector{ nullptr }; + AudioInjector* _snapshotSoundInjector { nullptr }; SharedSoundPointer _snapshotSound; };