- Fixed: Information added with addkeysection and addmenukey was never freed.

- Fixed: A classic decorate FakeInventory's PickupText was never freed.
- Fixed: Colored lights were never freed.
- Fixed: When a dehacked patch was applied, the dehacked StateMap was never
  freed.
- Removed termdone checks around atterm(S_ClearSoundData) and
  atterm(S_Shutdown) because atterm() already checks for duplicates.
- Fixed: S_ClearSoundData() should unload all sounds before it clears S_sfx.
- Fixed: AltSoundRenderer::LoadSound() didn't check if the sound had already
  been loaded and lost the old sound data if it had been.
- Fixed: FinishDehPatch() needlessly duplicated the new DehackedPickup's name.
- Fixed: PatchStrings() allocated a private string and never freed it.


SVN r183 (trunk)
This commit is contained in:
Randy Heit 2006-06-11 01:06:19 +00:00
commit 5859aa7194
9 changed files with 101 additions and 47 deletions

View file

@ -2941,6 +2941,30 @@ void M_SaveCustomKeys (FConfigFile *config, char *section, char *subsection)
static int AddKeySpot;
static void FreeKeySections()
{
const unsigned int numStdControls = countof(ControlsItems);
unsigned int i;
for (i = numStdControls; i < CustomControlsItems.Size(); ++i)
{
menuitem_t *item = &CustomControlsItems[i];
if (item->type == whitetext || item->type == control)
{
if (item->label != NULL)
{
delete[] item->label;
item->label = NULL;
}
if (item->e.command != NULL)
{
delete[] item->e.command;
item->e.command = NULL;
}
}
}
}
CCMD (addkeysection)
{
if (argv.argc() != 3)
@ -2973,6 +2997,7 @@ CCMD (addkeysection)
}
}
atterm (FreeKeySections);
if (i == last)
{ // Add the new section
// Limit the ini name to 32 chars