Fix lightGridPoints and demo entity joints memory leaks

This commit is contained in:
Stephen Saunders 2023-11-17 00:11:54 -05:00 committed by Robert Beckebans
parent 2335326a6b
commit cb209718be
2 changed files with 7 additions and 1 deletions

View file

@ -164,6 +164,9 @@ void idCommonLocal::StopPlayingRenderDemo()
readDemo->Close();
// SRS - free entity joints allocated by demo playback, otherwise will leak
R_FreeDerivedData();
soundWorld->StopAllSounds();
soundSystem->SetPlayingSoundWorld( menuSoundWorld );

View file

@ -57,6 +57,9 @@ void idRenderWorldLocal::FreeWorld()
R_StaticFree( portal );
}
// SRS - release the lightGridPoints idList or it will leak
area->lightGrid.lightGridPoints.Clear();
// there shouldn't be any remaining lightRefs or entityRefs
if( area->lightRefs.areaNext != &area->lightRefs )
{
@ -1186,4 +1189,4 @@ ResetLocalRenderModels
void idRenderWorldLocal::ResetLocalRenderModels()
{
localModels.Clear(); // Clear out the list when switching between expansion packs, so InitFromMap doesn't try to delete the list whose content has already been deleted by the model manager being re-started
}
}