diff --git a/src/client/game.cpp b/src/client/game.cpp index 27b58334f..f9f175d1b 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1219,8 +1219,7 @@ void Game::shutdown() /* cleanup menus */ while (g_menumgr.menuCount() > 0) { - g_menumgr.m_stack.front()->setVisible(false); - g_menumgr.deletingMenu(g_menumgr.m_stack.front()); + g_menumgr.deleteFront(); } m_game_ui->deleteFormspec(); diff --git a/src/gui/mainmenumanager.h b/src/gui/mainmenumanager.h index a37db2a32..d5f43796d 100644 --- a/src/gui/mainmenumanager.h +++ b/src/gui/mainmenumanager.h @@ -70,6 +70,12 @@ public: return m_stack.size(); } + void deleteFront() + { + m_stack.front()->setVisible(false); + deletingMenu(m_stack.front()); + } + bool pausesGame() { for (gui::IGUIElement *i : m_stack) { @@ -80,7 +86,7 @@ public: return false; } - // FIXME: why isn't this private? +private: std::list m_stack; };