History

standardize Audio bg thread joins

Zach Pomerantz committed 9 years ago

Commit cd2665f1 parent aea8b023 files · +68 −68Browse files

Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Application.cpp+4−7
@@ -1683,7 +1683,6 @@ void Application::updateHeartbeat() const { · 1682 unmodified lines
1683 1683
1684void Application::aboutToQuit() {1684void Application::aboutToQuit() {
1685 emit beforeAboutToQuit();1685 emit beforeAboutToQuit();
1686 DependencyManager::get<AudioClient>()->beforeAboutToQuit();
1687 1686
1688 foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {1687 foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
1689 if (inputPlugin->isActive()) {1688 if (inputPlugin->isActive()) {
@@ -1784,14 +1783,12 @@ void Application::cleanupBeforeQuit() { · 94 unmodified lines
1784 _snapshotSoundInjector->stop();1783 _snapshotSoundInjector->stop();
1785 }1784 }
1786 1785
1787 // stop audio after QML, as there are unexplained audio crashes originating in qtwebengine1786 // FIXME: something else is holding a reference to AudioClient,
1788 1787 // so it must be explicitly synchronously stopped here
1789 // stop the AudioClient, synchronously1788 QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "stop", Qt::BlockingQueuedConnection);
1790 QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
1791 "stop", Qt::BlockingQueuedConnection);
1792
1793 1789
1794 // destroy Audio so it and its threads have a chance to go down safely1790 // destroy Audio so it and its threads have a chance to go down safely
1791 // this must happen after QML, as there are unexplained audio crashes originating in qtwebengine
1795 DependencyManager::destroy<AudioClient>();1792 DependencyManager::destroy<AudioClient>();
1796 DependencyManager::destroy<AudioInjectorManager>();1793 DependencyManager::destroy<AudioInjectorManager>();
1797 1794