Centralize Windows App binding ownership

This commit is contained in:
2026-06-17 09:18:59 +02:00
parent d502bf9331
commit 01ff014dd9
2 changed files with 1 additions and 2 deletions

View File

@@ -53,7 +53,6 @@ void handle_window_close_message(VrShellState& vr)
runtime->ui_thread_stop(); runtime->ui_thread_stop();
runtime->render_thread_stop(); runtime->render_thread_stop();
app->terminate(); app->terminate();
App::I = nullptr;
bind_app(nullptr); bind_app(nullptr);
bind_runtime(nullptr); bind_runtime(nullptr);
delete app; delete app;

View File

@@ -124,6 +124,7 @@ void shutdown_main_window_runtime(const MainWindowStartupState& startup, HINSTAN
void bind_app(App* app) noexcept void bind_app(App* app) noexcept
{ {
retained_runtime_state().app = app; retained_runtime_state().app = app;
App::I = app;
} }
App* bound_app() noexcept App* bound_app() noexcept
@@ -157,7 +158,6 @@ int run_main_application(int argc, char** argv)
state.hInst = GetModuleHandle(NULL); state.hInst = GetModuleHandle(NULL);
auto* app = new App(); auto* app = new App();
App::I = app;
bind_app(app); bind_app(app);
bind_runtime(&app->runtime()); bind_runtime(&app->runtime());
bind_wacom_tablet(&WacomTablet::I); bind_wacom_tablet(&WacomTablet::I);