- Merged 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.
- Fixed: DCajunMaster did not free its getspawned.
- Fixed: P_FreeLevelData() did not free ACS scripts.
- Fixed: Level snapshots were not freed at exit.
- Fixed: The save/load menu list was not freed at exit.
- Fixed: FCompressedMemFile needs a destructor to free the m_ImplodedBuffer.
- Fixed: G_DoLoadGame() did not free the engine string.
- Fixed: M_ReadSaveStrings() did not free the engine string.
- Fixed: Processing DEM_SAVEGAME did not free the pathname string.
- Added a check for truncated flats to FFlatTexture::MakeTexture() because
  Heretic's F_SKY1 is only four bytes long.
- Added a dump of the offending state to the "Cannot find state..." diagnostic.
- Fixed: FCompressedFile did not initialize m_Mode in its default constructor.
- Fixed: Heretic and Hexen status bars did not initialize ArtiRefresh.
- Fixed: PNGHandle destructor should use delete[] to free TextChunks.


SVN r111 (trunk)
This commit is contained in:
Randy Heit 2006-05-12 03:14:40 +00:00
commit 8fcf93d65a
68 changed files with 866 additions and 485 deletions

View file

@ -49,6 +49,7 @@
#include "r_data.h"
#include "m_random.h"
#include "d_netinf.h"
#include "i_system.h"
// MACROS ------------------------------------------------------------------
@ -210,19 +211,6 @@ static const char *SICommandStrings[] =
static TArray<FRandomSoundList> S_rnd;
static FMusicVolume *MusicVolumes;
static struct MusicVolumeDeleter
{
~MusicVolumeDeleter()
{
while(MusicVolumes!=NULL)
{
FMusicVolume * next = MusicVolumes->Next;
free(MusicVolumes);
MusicVolumes=next;
}
}
} DeleteTheMusicVolumes;
static int NumPlayerReserves;
static bool DoneReserving;
static bool PlayerClassesIsSorted;
@ -568,26 +556,29 @@ static void S_ClearSoundData()
S_sfx.Clear();
for(i=0;i<256;i++)
for(i = 0; i < countof(Ambients); i++)
{
if (Ambients[i]) delete Ambients[i];
Ambients[i]=NULL;
if (Ambients[i] != NULL)
{
delete Ambients[i];
Ambients[i] = NULL;
}
}
while (MusicVolumes != NULL)
{
FMusicVolume * me = MusicVolumes;
FMusicVolume *me = MusicVolumes;
MusicVolumes = me->Next;
delete me;
}
S_rnd.Clear();
DoneReserving=false;
NumPlayerReserves=0;
PlayerClassesIsSorted=false;
DoneReserving = false;
NumPlayerReserves = 0;
PlayerClassesIsSorted = false;
PlayerClasses.Clear();
PlayerSounds.Clear();
DefPlayerClass=0;
*DefPlayerClassName=0;
DefPlayerClass = 0;
*DefPlayerClassName = 0;
}
//==========================================================================
@ -602,6 +593,7 @@ void S_ParseSndInfo ()
{
int lump;
atterm (S_ClearSoundData);
S_ClearSoundData(); // remove old sound data first!
CurrentPitchMask = 0;