Code nitpick. Pointer cleanup on exit

This commit is contained in:
Vladyslav Stelmakhovskyi 2017-04-20 21:12:57 +02:00
parent 06406ef7de
commit b2533b6106
2 changed files with 5 additions and 3 deletions

View file

@ -1780,18 +1780,20 @@ void Application::cleanupBeforeQuit() {
// stop QML
DependencyManager::destroy<OffscreenUi>();
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<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>();
// delete _snapshotSound;
// _snapshotSound = nullptr;
qCDebug(interfaceapp) << "Application::cleanupBeforeQuit() complete";
}

View file

@ -685,7 +685,7 @@ private:
QTimer _addAssetToWorldErrorTimer;
FileScriptingInterface* _fileDownload;
AudioInjector* _snapshotSoundInjector{ nullptr };
AudioInjector* _snapshotSoundInjector { nullptr };
SharedSoundPointer _snapshotSound;
};