From 1c92d6243fd42291d25798982c1dd1f1bd1013bb Mon Sep 17 00:00:00 2001 From: wrrrzr <161970349+wrrrzr@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:52:37 +0300 Subject: [PATCH] MainMenuManager: fix FIXME (#15414) --- src/client/game.cpp | 3 +-- src/gui/mainmenumanager.h | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) 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; };