mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-07 08:21:04 +00:00
- Fixed: The MBFParamStates array leaked memory.
SVN r1839 (trunk)
This commit is contained in:
parent
45842e28bd
commit
f1dc490151
1 changed files with 3 additions and 2 deletions
|
@ -149,7 +149,7 @@ static TArray<const PClass *> WeaponNames;
|
||||||
// List of states that are hacked to use a codepointer
|
// List of states that are hacked to use a codepointer
|
||||||
struct MBFParamState
|
struct MBFParamState
|
||||||
{
|
{
|
||||||
FState * state;
|
FState *state;
|
||||||
int pointer;
|
int pointer;
|
||||||
};
|
};
|
||||||
static TArray<MBFParamState *> MBFParamStates;
|
static TArray<MBFParamState *> MBFParamStates;
|
||||||
|
@ -1610,7 +1610,7 @@ static void SetPointer(FState *state, PSymbol *sym, int frame = 0)
|
||||||
{
|
{
|
||||||
if (!symname.CompareNoCase(MBFCodePointers[i].name))
|
if (!symname.CompareNoCase(MBFCodePointers[i].name))
|
||||||
{
|
{
|
||||||
MBFParamState * newstate = new MBFParamState;
|
MBFParamState *newstate = new MBFParamState;
|
||||||
newstate->state = state;
|
newstate->state = state;
|
||||||
newstate->pointer = i;
|
newstate->pointer = i;
|
||||||
MBFParamStates.Push(newstate);
|
MBFParamStates.Push(newstate);
|
||||||
|
@ -2495,6 +2495,7 @@ static void UnloadDehSupp ()
|
||||||
for (unsigned int i=0; i < MBFParamStates.Size(); i++)
|
for (unsigned int i=0; i < MBFParamStates.Size(); i++)
|
||||||
{
|
{
|
||||||
SetDehParams(MBFParamStates[i]->state, MBFParamStates[i]->pointer);
|
SetDehParams(MBFParamStates[i]->state, MBFParamStates[i]->pointer);
|
||||||
|
delete MBFParamStates[i];
|
||||||
}
|
}
|
||||||
MBFParamStates.Clear();
|
MBFParamStates.Clear();
|
||||||
MBFParamStates.ShrinkToFit();
|
MBFParamStates.ShrinkToFit();
|
||||||
|
|
Loading…
Reference in a new issue