diff --git a/src/guiengine/abstract_state_manager.cpp b/src/guiengine/abstract_state_manager.cpp index cf037a678..c680e4498 100644 --- a/src/guiengine/abstract_state_manager.cpp +++ b/src/guiengine/abstract_state_manager.cpp @@ -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());