Showing the changes to interface/src/Application.cpp (1 of 6 files). Show all
Unified · Split
| @@ -814,6 +814,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 813 unmodified lines | ||
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | // Tell the plugin manager about our statically linked plugins |
| 817 | + DependencyManager::set<PluginManager>(); | |
| 817 | 818 | auto pluginManager = PluginManager::getInstance(); |
| 818 | 819 | pluginManager->setInputPluginProvider([] { return getInputPlugins(); }); |
| 819 | 820 | pluginManager->setDisplayPluginProvider([] { return getDisplayPlugins(); }); |
| @@ -1375,6 +1376,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 555 unmodified lines | ||
| 1375 | 1376 | initializeRenderEngine(); |
| 1376 | 1377 | qCDebug(interfaceapp, "Initialized Render Engine."); |
| 1377 | 1378 | |
| 1379 | + // Overlays need to exist before we set the ContextOverlayInterface dependency | |
| 1380 | + _overlays.init(); // do this before scripts load | |
| 1381 | + DependencyManager::set<ContextOverlayInterface>(); | |
| 1382 | + | |
| 1378 | 1383 | // Initialize the user interface and menu system |
| 1379 | 1384 | // Needs to happen AFTER the render engine initialization to access its configuration |
| 1380 | 1385 | initializeUi(); |
| @@ -1511,10 +1516,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 130 unmodified lines | ||
| 1511 | 1516 | // allow you to move an entity around in your hand |
| 1512 | 1517 | _entityEditSender.setPacketsPerSecond(3000); // super high!! |
| 1513 | 1518 | |
| 1514 | − // Overlays need to exist before we set the ContextOverlayInterface dependency | |
| 1515 | − _overlays.init(); // do this before scripts load | |
| 1516 | − DependencyManager::set<ContextOverlayInterface>(); | |
| 1517 | − | |
| 1518 | 1519 | // Make sure we don't time out during slow operations at startup |
| 1519 | 1520 | updateHeartbeat(); |
| 1520 | 1521 | |
| @@ -2552,12 +2553,18 @@ Application::~Application() { · 1031 unmodified lines | ||
| 2552 | 2553 | _octreeProcessor.terminate(); |
| 2553 | 2554 | _entityEditSender.terminate(); |
| 2554 | 2555 | |
| 2556 | + if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { | |
| 2557 | + steamClient->shutdown(); | |
| 2558 | + } | |
| 2559 | + DependencyManager::destroy<PluginManager>(); | |
| 2560 | + | |
| 2561 | + DependencyManager::destroy<CompositorHelper>(); // must be destroyed before the FramebufferCache | |
| 2562 | + | |
| 2555 | 2563 | DependencyManager::destroy<AvatarManager>(); |
| 2556 | 2564 | DependencyManager::destroy<AnimationCache>(); |
| 2557 | 2565 | DependencyManager::destroy<FramebufferCache>(); |
| 2558 | 2566 | DependencyManager::destroy<TextureCache>(); |
| 2559 | 2567 | DependencyManager::destroy<ModelCache>(); |
| 2560 | − DependencyManager::destroy<GeometryCache>(); | |
| 2561 | 2568 | DependencyManager::destroy<ScriptCache>(); |
| 2562 | 2569 | DependencyManager::destroy<SoundCache>(); |
| 2563 | 2570 | DependencyManager::destroy<OctreeStatsProvider>(); |
| @@ -2567,10 +2574,6 @@ Application::~Application() { · 3 unmodified lines | ||
| 2567 | 2574 | // remove the NodeList from the DependencyManager |
| 2568 | 2575 | DependencyManager::destroy<NodeList>(); |
| 2569 | 2576 | |
| 2570 | − if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { | |
| 2571 | − steamClient->shutdown(); | |
| 2572 | − } | |
| 2573 | − | |
| 2574 | 2577 | #if 0 |
| 2575 | 2578 | ConnexionClient::getInstance().destroy(); |
| 2576 | 2579 | #endif |
| @@ -2890,6 +2893,7 @@ void Application::initializeUi() { · 313 unmodified lines | ||
| 2890 | 2893 | auto compositorHelper = DependencyManager::get<CompositorHelper>(); |
| 2891 | 2894 | connect(compositorHelper.data(), &CompositorHelper::allowMouseCaptureChanged, this, [=] { |
| 2892 | 2895 | if (isHMDMode()) { |
| 2896 | + auto compositorHelper = DependencyManager::get<CompositorHelper>(); // don't capture outer smartpointer | |
| 2893 | 2897 | showCursor(compositorHelper->getAllowMouseCapture() ? |
| 2894 | 2898 | Cursor::Manager::lookupIcon(_preferredCursor.get()) : |
| 2895 | 2899 | Cursor::Icon::SYSTEM); |