Merge pull request #604 from SRSaunders/sound-shutdown-fix

Properly delete renderWorld, soundWorld, and menuSoundWorld on shutdown
This commit is contained in:
Robert Beckebans 2021-09-11 12:54:47 +02:00 committed by GitHub
commit d0bb2c3cf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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