mirror of
https://github.com/DrBeef/Raze.git
synced 2025-03-22 01:01:04 +00:00
- clear menuDelegate in case of an error in MENUDEF parsing.
This commit is contained in:
parent
acfca3fbdc
commit
a570e77509
2 changed files with 8 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue