From 660304a0a39757085c33b0fe4c48e6a29a099451 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 7 Jan 2016 12:25:25 -0800 Subject: [PATCH] Stop QML hanging the app on shutdown --- interface/src/Application.cpp | 6 ++++-- libraries/gl/src/gl/OffscreenQmlSurface.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4a166d9b12..ede6a9b9b0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -696,7 +696,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : auto userInputMapper = DependencyManager::get(); connect(userInputMapper.data(), &UserInputMapper::actionEvent, [this](int action, float state) { using namespace controller; - static auto offscreenUi = DependencyManager::get(); + auto offscreenUi = DependencyManager::get(); if (offscreenUi->navigationFocused()) { auto actionEnum = static_cast(action); int key = Qt::Key_unknown; @@ -836,7 +836,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : return (float)qApp->getMyAvatar()->getCharacterController()->onGround(); })); _applicationStateDevice->addInputVariant(QString("NavigationFocused"), controller::StateController::ReadLambda([]() -> float { - static auto offscreenUi = DependencyManager::get(); + auto offscreenUi = DependencyManager::get(); return offscreenUi->navigationFocused() ? 1.0 : 0.0; })); @@ -1051,6 +1051,8 @@ void Application::cleanupBeforeQuit() { #ifdef HAVE_IVIEWHMD DependencyManager::destroy(); #endif + + DependencyManager::destroy(); } void Application::emptyLocalCache() { diff --git a/libraries/gl/src/gl/OffscreenQmlSurface.cpp b/libraries/gl/src/gl/OffscreenQmlSurface.cpp index f89f1f5b72..d9e8579d58 100644 --- a/libraries/gl/src/gl/OffscreenQmlSurface.cpp +++ b/libraries/gl/src/gl/OffscreenQmlSurface.cpp @@ -254,7 +254,7 @@ private: _quit = true; } - static const uint64_t MAX_SHUTDOWN_WAIT_SECS = 5; + static const uint64_t MAX_SHUTDOWN_WAIT_SECS = 2; void stop() { if (_thread.isRunning()) { qDebug() << "Stopping QML render thread " << _thread.currentThreadId();