- clear menuDelegate in case of an error in MENUDEF parsing.

This commit is contained in:
Christoph Oelckers 2023-01-20 17:10:25 +01:00
parent acfca3fbdc
commit a570e77509
2 changed files with 8 additions and 2 deletions

View file

@ -924,10 +924,16 @@ void M_Init (void)
}
catch (CVMAbortException &err)
{
menuDelegate = nullptr;
err.MaybePrintMessage();
Printf(PRINT_NONOTIFY | PRINT_BOLD, "%s", err.stacktrace.GetChars());
I_FatalError("Failed to initialize menus");
}
catch (...)
{
menuDelegate = nullptr;
throw;
}
M_CreateMenus();
}

View file

@ -150,13 +150,13 @@ void DeinitMenus()
pair->Value = nullptr;
}
}
MenuDescriptors.Clear();
OptionValues.Clear();
if (menuDelegate)
{
menuDelegate->Destroy();
menuDelegate = nullptr;
}
MenuDescriptors.Clear();
OptionValues.Clear();
}
FTextureID GetMenuTexture(const char* const name)