diff --git a/src/skate3_app_common.cpp b/src/skate3_app_common.cpp index fb0b3c1..4266aff 100644 --- a/src/skate3_app_common.cpp +++ b/src/skate3_app_common.cpp @@ -909,7 +909,11 @@ void Skate3BaseApp::ToggleSimpleSettings() { // zeroes guest-facing input while the settings screen is open. auto poll_gamepad = [this]() { rex::ui::SimpleSettingsGamepad pad; - auto* input_system = static_cast(runtime()->input_system()); + // The dialog can be painted (and thus poll) during a frame that races + // runtime teardown at close time, when runtime() is already gone. + auto* rt = runtime(); + auto* input_system = + rt ? static_cast(rt->input_system()) : nullptr; if (input_system) { rex::input::X_INPUT_GAMEPAD state; if (input_system->GetUiGamepadState(&state)) {