Fix crash if top screen is networking lobby --connect-now

This commit is contained in:
Benau 2019-03-29 14:38:38 +08:00
parent 1994fba62b
commit ecc0007b29
2 changed files with 5 additions and 3 deletions

View File

@ -28,7 +28,7 @@
#include <vector>
#include <iostream>
#include <IGUIEnvironment.h>
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;
}

0
src/states_screens/race_result_gui.cpp Executable file → Normal file
View File