diff --git a/src/platform_windows/windows_lifecycle_shell.cpp b/src/platform_windows/windows_lifecycle_shell.cpp index 33968b0b..e9b558cf 100644 --- a/src/platform_windows/windows_lifecycle_shell.cpp +++ b/src/platform_windows/windows_lifecycle_shell.cpp @@ -53,7 +53,6 @@ void handle_window_close_message(VrShellState& vr) runtime->ui_thread_stop(); runtime->render_thread_stop(); app->terminate(); - App::I = nullptr; bind_app(nullptr); bind_runtime(nullptr); delete app; diff --git a/src/platform_windows/windows_runtime_shell.cpp b/src/platform_windows/windows_runtime_shell.cpp index d43bc6e1..74eb8ca7 100644 --- a/src/platform_windows/windows_runtime_shell.cpp +++ b/src/platform_windows/windows_runtime_shell.cpp @@ -124,6 +124,7 @@ void shutdown_main_window_runtime(const MainWindowStartupState& startup, HINSTAN void bind_app(App* app) noexcept { retained_runtime_state().app = app; + App::I = app; } App* bound_app() noexcept @@ -157,7 +158,6 @@ int run_main_application(int argc, char** argv) state.hInst = GetModuleHandle(NULL); auto* app = new App(); - App::I = app; bind_app(app); bind_runtime(&app->runtime()); bind_wacom_tablet(&WacomTablet::I);