From f1dc4901519a5c95815eac28c46010fe5a6f78d9 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 15 Sep 2009 22:44:07 +0000 Subject: [PATCH] - Fixed: The MBFParamStates array leaked memory. SVN r1839 (trunk) --- src/d_dehacked.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index f63978190..d21ac079d 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -149,7 +149,7 @@ static TArray WeaponNames; // List of states that are hacked to use a codepointer struct MBFParamState { - FState * state; + FState *state; int pointer; }; static TArray MBFParamStates; @@ -1610,7 +1610,7 @@ static void SetPointer(FState *state, PSymbol *sym, int frame = 0) { if (!symname.CompareNoCase(MBFCodePointers[i].name)) { - MBFParamState * newstate = new MBFParamState; + MBFParamState *newstate = new MBFParamState; newstate->state = state; newstate->pointer = i; MBFParamStates.Push(newstate); @@ -2495,6 +2495,7 @@ static void UnloadDehSupp () for (unsigned int i=0; i < MBFParamStates.Size(); i++) { SetDehParams(MBFParamStates[i]->state, MBFParamStates[i]->pointer); + delete MBFParamStates[i]; } MBFParamStates.Clear(); MBFParamStates.ShrinkToFit();