From ecc0007b2970c3ee29ce9fee39e5c9ad6ce77a2e Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 29 Mar 2019 14:38:38 +0800 Subject: [PATCH] Fix crash if top screen is networking lobby --connect-now --- src/guiengine/abstract_state_manager.cpp | 8 +++++--- src/states_screens/race_result_gui.cpp | 0 2 files changed, 5 insertions(+), 3 deletions(-) mode change 100755 => 100644 src/states_screens/race_result_gui.cpp diff --git a/src/guiengine/abstract_state_manager.cpp b/src/guiengine/abstract_state_manager.cpp index db438f843..a5cf469ec 100644 --- a/src/guiengine/abstract_state_manager.cpp +++ b/src/guiengine/abstract_state_manager.cpp @@ -28,7 +28,7 @@ #include #include - +#include using namespace GUIEngine; @@ -212,15 +212,17 @@ void AbstractStateManager::popMenu() { assert(m_game_mode != GAME); - if (m_menu_stack.size() == 0) + if (m_menu_stack.empty()) return; // Send tear-down event to menu getCurrentScreen()->tearDown(); m_menu_stack.pop_back(); - if (m_menu_stack.size() == 0) + if (m_menu_stack.empty()) { + getGUIEnv()->clear(); + getCurrentScreen()->elementsWereDeleted(); onStackEmptied(); return; } diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp old mode 100755 new mode 100644