mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:09:34 +02:00
cleanup qml before audio
This commit is contained in:
parent
164955dc81
commit
5413d97089
1 changed files with 11 additions and 12 deletions
|
@ -1556,17 +1556,6 @@ void Application::cleanupBeforeQuit() {
|
||||||
saveSettings();
|
saveSettings();
|
||||||
_window->saveGeometry();
|
_window->saveGeometry();
|
||||||
|
|
||||||
// stop the AudioClient
|
|
||||||
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
|
|
||||||
"stop", Qt::BlockingQueuedConnection);
|
|
||||||
|
|
||||||
// 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.
|
// Destroy third party processes after scripts have finished using them.
|
||||||
#ifdef HAVE_DDE
|
#ifdef HAVE_DDE
|
||||||
DependencyManager::destroy<DdeFaceTracker>();
|
DependencyManager::destroy<DdeFaceTracker>();
|
||||||
|
@ -1575,7 +1564,18 @@ void Application::cleanupBeforeQuit() {
|
||||||
DependencyManager::destroy<EyeTracker>();
|
DependencyManager::destroy<EyeTracker>();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// stop QML
|
||||||
DependencyManager::destroy<OffscreenUi>();
|
DependencyManager::destroy<OffscreenUi>();
|
||||||
|
|
||||||
|
// stop audio after QML, as the qtwebengine may use it, and may crash if it is already stopped
|
||||||
|
|
||||||
|
// stop the AudioClient, synchronously
|
||||||
|
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
|
||||||
|
"stop", Qt::BlockingQueuedConnection);
|
||||||
|
|
||||||
|
// destroy Audio so it and its threads have a chance to go down safely
|
||||||
|
DependencyManager::destroy<AudioClient>();
|
||||||
|
DependencyManager::destroy<AudioInjectorManager>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::~Application() {
|
Application::~Application() {
|
||||||
|
@ -1596,7 +1596,6 @@ Application::~Application() {
|
||||||
DependencyManager::get<AvatarManager>()->getObjectsToRemoveFromPhysics(motionStates);
|
DependencyManager::get<AvatarManager>()->getObjectsToRemoveFromPhysics(motionStates);
|
||||||
_physicsEngine->removeObjects(motionStates);
|
_physicsEngine->removeObjects(motionStates);
|
||||||
|
|
||||||
DependencyManager::destroy<OffscreenUi>();
|
|
||||||
DependencyManager::destroy<AvatarManager>();
|
DependencyManager::destroy<AvatarManager>();
|
||||||
DependencyManager::destroy<AnimationCache>();
|
DependencyManager::destroy<AnimationCache>();
|
||||||
DependencyManager::destroy<FramebufferCache>();
|
DependencyManager::destroy<FramebufferCache>();
|
||||||
|
|
Loading…
Reference in a new issue