- 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

@ -6,6 +6,7 @@
#include "cmdlib.h"
#include "templates.h"
#include "w_wad.h"
#include "i_system.h"
struct FEAXField
{
@ -382,25 +383,6 @@ ReverbContainer *DefaultEnvironments[26] =
ReverbContainer *Environments = &Off;
static struct ReverbContainerDeleter
{
~ReverbContainerDeleter()
{
ReverbContainer *probe = Environments;
while (probe != NULL)
{
ReverbContainer *next = probe->Next;
if (!probe->Builtin)
{
delete[] const_cast<char *>(probe->Name);
delete probe;
}
probe = next;
}
}
} DeleteTheReverbContainers;
ReverbContainer *S_FindEnvironment (const char *name)
{
ReverbContainer *probe = Environments;
@ -587,6 +569,8 @@ void S_ParseSndEax ()
{
int lump, lastlump = 0;
atterm (S_UnloadSndEax);
while ((lump = Wads.FindLump ("SNDEAX", &lastlump)) != -1)
{
SC_OpenLumpNum (lump, "SNDEAX");
@ -594,3 +578,20 @@ void S_ParseSndEax ()
SC_Close ();
}
}
void S_UnloadSndEax ()
{
ReverbContainer *probe = Environments;
while (probe != NULL)
{
ReverbContainer *next = probe->Next;
if (!probe->Builtin)
{
delete[] const_cast<char *>(probe->Name);
delete probe;
}
probe = next;
}
Environments = &Off;
}