mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-03 17:32:54 +00:00
- fixed: The intermission data was never freed.
SVN r2955 (trunk)
This commit is contained in:
parent
8b63758019
commit
f318653a11
3 changed files with 30 additions and 2 deletions
|
@ -1787,6 +1787,20 @@ void FMapInfoParser::ParseMapInfo (int lump, level_info_t &gamedefaults, level_i
|
|||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void DeinitIntermissions();
|
||||
|
||||
static void ClearMapinfo()
|
||||
{
|
||||
ClearEpisodes();
|
||||
DeinitIntermissions();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// G_ParseMapInfo
|
||||
|
@ -1800,7 +1814,7 @@ void G_ParseMapInfo (const char *basemapinfo)
|
|||
int lump, lastlump = 0;
|
||||
level_info_t gamedefaults;
|
||||
|
||||
atterm(ClearEpisodes);
|
||||
atterm(ClearMapinfo);
|
||||
|
||||
// Parse the default MAPINFO for the current game. This lump *MUST* come from zdoom.pk3.
|
||||
if (basemapinfo != NULL)
|
||||
|
|
|
@ -80,6 +80,7 @@ struct FIntermissionAction
|
|||
TArray<FIntermissionPatch> mOverlays;
|
||||
|
||||
FIntermissionAction();
|
||||
virtual ~FIntermissionAction() {}
|
||||
virtual bool ParseKey(FScanner &sc);
|
||||
};
|
||||
|
||||
|
@ -145,7 +146,7 @@ struct FIntermissionActionScroller : public FIntermissionAction
|
|||
struct FIntermissionDescriptor
|
||||
{
|
||||
FName mLink;
|
||||
TArray<FIntermissionAction *> mActions;
|
||||
TDeletingArray<FIntermissionAction *> mActions;
|
||||
};
|
||||
|
||||
typedef TMap<FName, FIntermissionDescriptor*> FIntermissionDescriptorList;
|
||||
|
|
|
@ -47,6 +47,19 @@ static void ReplaceIntermission(FName intname,FIntermissionDescriptor *desc)
|
|||
IntermissionDescriptors[intname] = desc;
|
||||
}
|
||||
|
||||
void DeinitIntermissions()
|
||||
{
|
||||
FIntermissionDescriptorList::Iterator it(IntermissionDescriptors);
|
||||
|
||||
FIntermissionDescriptorList::Pair *pair;
|
||||
|
||||
while (it.NextPair(pair))
|
||||
{
|
||||
delete pair->Value;
|
||||
pair->Value = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FIntermissionAction
|
||||
|
|
Loading…
Reference in a new issue