Fix a crash.

This commit is contained in:
toasterbabe 2017-09-25 20:35:04 +01:00
parent 295b100df4
commit 7fb2e6633e
1 changed files with 8 additions and 3 deletions

View File

@ -2151,6 +2151,8 @@ static void M_GoBack(INT32 choice)
if ((currentMenu->prevMenu == &MainDef) && (currentMenu == &SP_TimeAttackDef || currentMenu == &SP_NightsAttackDef))
{
// D_StartTitle does its own wipe, since GS_TIMEATTACK is now a complete gamestate.
Z_Free(levelselect.rows);
levelselect.rows = NULL;
menuactive = false;
D_StartTitle();
}
@ -4279,6 +4281,12 @@ static void M_HandleLevelPlatter(INT32 choice)
if (exitmenu)
{
if (gamestate != GS_TIMEATTACK)
{
Z_Free(levelselect.rows);
levelselect.rows = NULL;
}
if (currentMenu->prevMenu)
{
M_SetupNextMenu(currentMenu->prevMenu);
@ -4287,9 +4295,6 @@ static void M_HandleLevelPlatter(INT32 choice)
else
M_ClearMenus(true);
Z_Free(levelselect.rows);
levelselect.rows = NULL;
Z_Free(char_notes);
char_notes = NULL;
}