History

Fix assert on interaction with stats and avatarinputs during UI setup

Brad Davis committed 8 years ago

Commit 6cc36131 parent 8bfc6101 file · +3 −2Browse files

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

Unified · Split

interface/src/Application.cpp+3−2
@@ -2681,7 +2681,6 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 2680 unmodified lines
26812681 surfaceContext->setContextProperty("Overlays", &_overlays);
26822682 surfaceContext->setContextProperty("Window", DependencyManager::get<WindowScriptingInterface>().data());
26832683 surfaceContext->setContextProperty("MenuInterface", MenuScriptingInterface::getInstance());
2684− surfaceContext->setContextProperty("Stats", Stats::getInstance());
26852684 surfaceContext->setContextProperty("Settings", SettingsScriptingInterface::getInstance());
26862685 surfaceContext->setContextProperty("ScriptDiscoveryService", DependencyManager::get<ScriptEngines>().data());
26872686 surfaceContext->setContextProperty("AvatarBookmarks", DependencyManager::get<AvatarBookmarks>().data());
@@ -2711,7 +2710,6 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 23 unmodified lines
27112710
27122711 surfaceContext->setContextProperty("ApplicationCompositor", &getApplicationCompositor());
27132712
2714− surfaceContext->setContextProperty("AvatarInputs", AvatarInputs::getInstance());
27152713 surfaceContext->setContextProperty("Selection", DependencyManager::get<SelectionScriptingInterface>().data());
27162714 surfaceContext->setContextProperty("ContextOverlay", DependencyManager::get<ContextOverlayInterface>().data());
27172715 surfaceContext->setContextProperty("Wallet", DependencyManager::get<WalletScriptingInterface>().data());
@@ -2726,6 +2724,9 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 8 unmodified lines
27262724 void Application::onDesktopRootItemCreated(QQuickItem* rootItem) {
27272725 Stats::show();
27282726 AvatarInputs::show();
2727+ auto surfaceContext = DependencyManager::get<OffscreenUi>()->getSurfaceContext();
2728+ surfaceContext->setContextProperty("Stats", Stats::getInstance());
2729+ surfaceContext->setContextProperty("AvatarInputs", AvatarInputs::getInstance());
27292730 }
27302731
27312732 void Application::updateCamera(RenderArgs& renderArgs, float deltaTime) {