From 05f634228e1544db7864ac6da7496d3322466c8c Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 15 Nov 2019 16:32:49 +0800 Subject: [PATCH] Fix invalid read of boolean after dialog dismissed --- src/states_screens/dialogs/race_paused_dialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/states_screens/dialogs/race_paused_dialog.cpp b/src/states_screens/dialogs/race_paused_dialog.cpp index 7690a6f73..b07ca88be 100644 --- a/src/states_screens/dialogs/race_paused_dialog.cpp +++ b/src/states_screens/dialogs/race_paused_dialog.cpp @@ -209,6 +209,7 @@ GUIEngine::EventPropagation if (selection == "exit") { + bool from_overworld = m_from_overworld; ModalDialog::dismiss(); if (STKHost::existHost()) { @@ -228,7 +229,7 @@ GUIEngine::EventPropagation StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance()); // Pause story mode timer when quitting story mode - if (m_from_overworld) + if (from_overworld) story_mode_timer->pauseTimer(/*loading screen*/ false); if (race_manager->raceWasStartedFromOverworld())