- plugged all memory leaks that were reported with Shadow Warrior when starting the first level.

This commit is contained in:
Christoph Oelckers 2019-12-25 11:26:19 +01:00
parent 5e821de481
commit b0cefdedce
21 changed files with 102 additions and 430 deletions

View file

@ -310,6 +310,11 @@ int GameMain()
I_ShowFatalError(err.what());
r = -1;
}
M_ClearMenus(true);
if (gi)
{
gi->FreeGameData(); // Must be done before taking down any subsystems.
}
S_StopMusic(true);
if (soundEngine) delete soundEngine;
soundEngine = nullptr;
@ -325,9 +330,9 @@ int GameMain()
I_ShutdownGraphics();
M_DeinitMenus();
paletteFreeColorTables();
engineUnInit();
if (gi)
{
gi->FreeGameData();
delete gi;
gi = nullptr;
}