Don't crash when calling popMenu() with empty stack.
Maybe quit button in main menu gets two click events while it's waiting for app destroy event.
This commit is contained in:
@@ -209,6 +209,9 @@ void AbstractStateManager::popMenu()
|
||||
{
|
||||
assert(m_game_mode != GAME);
|
||||
|
||||
if (m_menu_stack.size() == 0)
|
||||
return;
|
||||
|
||||
// Send tear-down event to menu
|
||||
getCurrentScreen()->tearDown();
|
||||
m_menu_stack.pop_back();
|
||||
|
||||
Reference in New Issue
Block a user