- fixed: The intermission data was never freed.

SVN r2955 (trunk)
This commit is contained in:
Christoph Oelckers 2010-10-17 13:25:21 +00:00
parent 8b63758019
commit f318653a11
3 changed files with 30 additions and 2 deletions

View file

@ -1787,6 +1787,20 @@ void FMapInfoParser::ParseMapInfo (int lump, level_info_t &gamedefaults, level_i
} }
//==========================================================================
//
//
//
//==========================================================================
void DeinitIntermissions();
static void ClearMapinfo()
{
ClearEpisodes();
DeinitIntermissions();
}
//========================================================================== //==========================================================================
// //
// G_ParseMapInfo // G_ParseMapInfo
@ -1800,7 +1814,7 @@ void G_ParseMapInfo (const char *basemapinfo)
int lump, lastlump = 0; int lump, lastlump = 0;
level_info_t gamedefaults; level_info_t gamedefaults;
atterm(ClearEpisodes); atterm(ClearMapinfo);
// Parse the default MAPINFO for the current game. This lump *MUST* come from zdoom.pk3. // Parse the default MAPINFO for the current game. This lump *MUST* come from zdoom.pk3.
if (basemapinfo != NULL) if (basemapinfo != NULL)

View file

@ -80,6 +80,7 @@ struct FIntermissionAction
TArray<FIntermissionPatch> mOverlays; TArray<FIntermissionPatch> mOverlays;
FIntermissionAction(); FIntermissionAction();
virtual ~FIntermissionAction() {}
virtual bool ParseKey(FScanner &sc); virtual bool ParseKey(FScanner &sc);
}; };
@ -145,7 +146,7 @@ struct FIntermissionActionScroller : public FIntermissionAction
struct FIntermissionDescriptor struct FIntermissionDescriptor
{ {
FName mLink; FName mLink;
TArray<FIntermissionAction *> mActions; TDeletingArray<FIntermissionAction *> mActions;
}; };
typedef TMap<FName, FIntermissionDescriptor*> FIntermissionDescriptorList; typedef TMap<FName, FIntermissionDescriptor*> FIntermissionDescriptorList;

View file

@ -47,6 +47,19 @@ static void ReplaceIntermission(FName intname,FIntermissionDescriptor *desc)
IntermissionDescriptors[intname] = desc; IntermissionDescriptors[intname] = desc;
} }
void DeinitIntermissions()
{
FIntermissionDescriptorList::Iterator it(IntermissionDescriptors);
FIntermissionDescriptorList::Pair *pair;
while (it.NextPair(pair))
{
delete pair->Value;
pair->Value = NULL;
}
}
//========================================================================== //==========================================================================
// //
// FIntermissionAction // FIntermissionAction