From aa767c360ca7f342cfc4ec87d4df623792b57488 Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Tue, 31 Aug 2021 10:49:57 -0400 Subject: [PATCH] Properly delete renderWorld, soundWorld, and menuSoundWorld on shutdown --- neo/framework/Common.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/neo/framework/Common.cpp b/neo/framework/Common.cpp index f05513d9..a91d286d 100644 --- a/neo/framework/Common.cpp +++ b/neo/framework/Common.cpp @@ -1540,15 +1540,18 @@ void idCommonLocal::Shutdown() ImGuiHook::Destroy(); printf( "delete renderWorld;\n" ); - delete renderWorld; + // SRS - Call FreeRenderWorld() vs. delete, otherwise worlds list not updated on shutdown + renderSystem->FreeRenderWorld( renderWorld ); renderWorld = NULL; printf( "delete soundWorld;\n" ); - delete soundWorld; + // SRS - Call FreeSoundWorld() vs. delete, otherwise soundWorlds list not updated and can segfault in soundSystem->Shutdown() + soundSystem->FreeSoundWorld( soundWorld ); soundWorld = NULL; printf( "delete menuSoundWorld;\n" ); - delete menuSoundWorld; + // SRS - Call FreeSoundWorld() vs. delete, otherwise soundWorlds list not updated and can segfault in soundSystem->Shutdown() + soundSystem->FreeSoundWorld( menuSoundWorld ); menuSoundWorld = NULL; // shut down the session