- Yay! We now seem to be free of memory leaks! The next step will be to

merge a lot of these static destructor-only structs into regular
  functions added to the exit chain with atterm so that they can be called
  in a deterministic order and not whatever order the linker decides to put
  them in. (Interestingly, the amount of memory used when repeatedly
  executing the same map command at the console varies up and down, but it
  now stays relatively stable rather than increasing unbounded.)
- Fixed: The list of resolutions in the video modes menu was not freed
  at exit.
- Fixed: mus_playing.name was not freed at exit.
- Fixed: SN_StopAllSequences() should be called at the start of
  P_FreeLevelData(), not just before the call to P_SetupLevel() in
  G_DoLoadLevel(), so it can run even at exit. And C_FullConsole() can
  call P_FreeLevelData() to free more memory too.
- Fixed: StatusBar was not freed at exit.
- Fixed: spritesorter was not freed at exit.
- Fixed: Bad things happened if FString's data pool was destroyed before
  all C_RemoveTabCommand() calls were made.
- Added an overload for FArchive << FString.
- Fixed: The players' log text was not freed at exit.
- Fixed: Bot information was not freed at exit.
- Fixed: doomcom was not freed at exit. But since it's always created,
  there's no reason why it needs to be allocated from the heap. My guess
  is that in the DOS days, the external packet driver was responsible for
  allocating doomcom and passed its location with the -net parameter.
- Fixed: FBlockNodes were not freed at exit.
- Fixed: Openings were not freed at exit.
- Fixed: Drawsegs were not freed at exit.
- Fixed: Vissprites were not freed at exit.
- Fixed: Console command history was not freed at exit.
- Fixed: Visplanes were not freed at exit.
- Fixed: Call P_FreeLevelData() at exit.
- Fixed: Channel, SoundCurve, and PlayList in s_sound.cpp were not freed at
  exit.
- Fixed: Sound sequences were not freed at exit.
- Fixed: DSeqNode::Serialize() did not resize the m_SequenceChoices array
  when loading.


SVN r106 (trunk)
This commit is contained in:
Randy Heit 2006-05-11 04:00:58 +00:00
commit a0c88a9b31
22 changed files with 432 additions and 199 deletions

View file

@ -678,6 +678,18 @@ vissprite_t **vissprite_p;
vissprite_t **lastvissprite;
int newvissprite;
static struct VisSpriteDeleter
{
~VisSpriteDeleter()
{
for (int i = 0; i < MaxVisSprites; ++i)
{
delete vissprites[i];
}
free (vissprites);
}
} DeleteTheVisSprites;
static void R_CreateSkinTranslation (const char *palname)
{
FMemLump lump = Wads.ReadLump (palname);
@ -832,7 +844,6 @@ vissprite_t *R_NewVisSprite (void)
return *(vissprite_p-1);
}
//
// R_DrawMaskedColumn
// Used for sprites and masked mid textures.
@ -1555,8 +1566,18 @@ static vissprite_t **spritesorter;
static int spritesortersize = 0;
static int vsprcount;
static drawseg_t **drawsegsorter;
static int drawsegsortersize = 0;
static struct SpriteSorterFree
{
~SpriteSorterFree()
{
if (spritesorter != NULL)
{
delete[] spritesorter;
spritesortersize = 0;
spritesorter = NULL;
}
}
} SpriteSorterFree_er;
// Sort vissprites by depth, far to near
static int STACK_ARGS sv_compare (const void *arg1, const void *arg2)
@ -1569,6 +1590,9 @@ static int STACK_ARGS sv_compare (const void *arg1, const void *arg2)
}
#if 0
static drawseg_t **drawsegsorter;
static int drawsegsortersize = 0;
// Sort vissprites by leftmost column, left to right
static int STACK_ARGS sv_comparex (const void *arg1, const void *arg2)
{