From d9a7465c089cecbef35ea25e361264268c471612 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 20 Jul 2021 20:11:29 +1000 Subject: [PATCH] - SW: Remove `gi->FreeGameData()` from game as its inside code wasn't freeing game data but level data already freed in `gi->FreeLevelData()`. * This was causing `GameMain()` to try to call `TerminateLevel()` after tile data had been freed, causing a hard stop. * Fixes #464. --- source/games/sw/src/game.cpp | 5 ----- source/games/sw/src/game.h | 1 - 2 files changed, 6 deletions(-) diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index 564421b15..fb27a714e 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -754,11 +754,6 @@ GameStats GameInterface::getStats() return { pp->Kills, TotalKillable, pp->SecretsFound, LevelSecrets, PlayClock / 120, 0 }; } -void GameInterface::FreeGameData() -{ - TerminateLevel(); -} - void GameInterface::FreeLevelData() { TerminateLevel(); diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 752fc11da..77b4ca871 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -2237,7 +2237,6 @@ struct GameInterface : public ::GameInterface void LoadGameTextures(); void loadPalette(); void clearlocalinputstate() override; - void FreeGameData() override; void FreeLevelData() override; bool GenerateSavePic() override; void MenuSound(EMenuSounds snd) override;