From 7b23effc023432a23d6a43af11092208e9aca4ae Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 15 Sep 2009 23:31:28 +0000 Subject: [PATCH] - Now that I think about it, why is MBFParamStates an array of pointers, anyway? SVN r1840 (trunk) --- src/d_dehacked.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index d21ac079d7..1ac3ff287f 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -152,7 +152,7 @@ struct MBFParamState FState *state; int pointer; }; -static TArray MBFParamStates; +static TArray MBFParamStates; // Data on how to correctly modify the codepointers struct CodePointerAlias { @@ -1610,9 +1610,9 @@ static void SetPointer(FState *state, PSymbol *sym, int frame = 0) { if (!symname.CompareNoCase(MBFCodePointers[i].name)) { - MBFParamState *newstate = new MBFParamState; - newstate->state = state; - newstate->pointer = i; + MBFParamState newstate; + newstate.state = state; + newstate.pointer = i; MBFParamStates.Push(newstate); break; // No need to cycle through the rest of the list. } @@ -2494,8 +2494,7 @@ static void UnloadDehSupp () // Handle MBF params here, before the required arrays are cleared for (unsigned int i=0; i < MBFParamStates.Size(); i++) { - SetDehParams(MBFParamStates[i]->state, MBFParamStates[i]->pointer); - delete MBFParamStates[i]; + SetDehParams(MBFParamStates[i].state, MBFParamStates[i].pointer); } MBFParamStates.Clear(); MBFParamStates.ShrinkToFit();