mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Clean up menus properly on client exit (#16150)
This commit is contained in:
parent
dca88be81d
commit
8c8b7cb251
4 changed files with 12 additions and 9 deletions
|
@ -1114,8 +1114,12 @@ void Game::run()
|
|||
|
||||
void Game::shutdown()
|
||||
{
|
||||
// Clear text when exiting.
|
||||
// Delete text and menus first
|
||||
m_game_ui->clearText();
|
||||
m_game_formspec.reset();
|
||||
while (g_menumgr.menuCount() > 0) {
|
||||
g_menumgr.deleteFront();
|
||||
}
|
||||
|
||||
if (g_touchcontrols)
|
||||
g_touchcontrols->hide();
|
||||
|
@ -1126,11 +1130,6 @@ void Game::shutdown()
|
|||
|
||||
sky.reset();
|
||||
|
||||
/* cleanup menus */
|
||||
while (g_menumgr.menuCount() > 0) {
|
||||
g_menumgr.deleteFront();
|
||||
}
|
||||
|
||||
// only if the shutdown progress bar isn't shown yet
|
||||
if (m_shutdown_progress == 0.0f)
|
||||
showOverlayMessage(N_("Shutting down..."), 0, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue