- let M_ClearMenus destroy all open menus so that they can properly deinitialize.

This commit is contained in:
Christoph Oelckers 2017-02-19 16:08:10 +01:00
parent fb52b034b0
commit c0f588e234

View file

@ -769,10 +769,11 @@ void M_Drawer (void)
void M_ClearMenus() void M_ClearMenus()
{ {
M_DemoNoPlay = false; M_DemoNoPlay = false;
if (CurrentMenu != nullptr) while (CurrentMenu != nullptr)
{ {
DMenu* parent = CurrentMenu->mParentMenu;
CurrentMenu->Destroy(); CurrentMenu->Destroy();
CurrentMenu = nullptr; CurrentMenu = parent;
} }
V_SetBorderNeedRefresh(); V_SetBorderNeedRefresh();
menuactive = MENU_Off; menuactive = MENU_Off;