caught potential bug in abstract_state_manager

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5352 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-05-02 20:36:20 +00:00
parent 230b95b460
commit 77ecba5bc4

View File

@ -118,8 +118,10 @@ void AbstractStateManager::replaceTopMostScreen(Screen* screen)
if (!screen->isLoaded()) screen->loadFromFile();
std::string name = screen->getName();
assert(m_menu_stack.size() > 0);
// Send tear-down event to previous menu
if (m_menu_stack.size() > 0) getCurrentScreen()->tearDown();
getCurrentScreen()->tearDown();
m_menu_stack[m_menu_stack.size()-1] = name;
switchToScreen(name.c_str());