From aade32a749c3509d198e445e0b455e4c27ee6e6f Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 26 Oct 2012 19:52:24 +0000 Subject: [PATCH] - Add PClass::AllClasses to the list of root items for the GC. Failure to do so will cause any actors with names that conflicted with preceding actors from being freed, even though they can still be accessed via PClassActor::AllActorClasses, which gets iterated over in a number of places. (e.g. Zen Dynamics defines a Grenade actor, although there is one in zdoom.pk3 now. The Zen Dynamics' version would not go in the TypeTable, so it would be collected on map load, leading to a crash when attempts to access it through AllActorClasses are made.) SVN r3908 (scripting) --- src/dobjgc.cpp | 4 ++++ src/thingdef/thingdef_expression.cpp | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dobjgc.cpp b/src/dobjgc.cpp index 59e099006..05cc73aed 100644 --- a/src/dobjgc.cpp +++ b/src/dobjgc.cpp @@ -365,6 +365,10 @@ static void MarkRoot() } // Mark types TypeTable.Mark(); + for (unsigned int i = 0; i < PClass::AllClasses.Size(); ++i) + { + Mark(PClass::AllClasses[i]); + } // Mark bot stuff. Mark(bglobal.firstthing); Mark(bglobal.body1); diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index d1c225e90..2ebea2a46 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -3964,7 +3964,6 @@ static int DoFindState(VMFrameStack *stack, VMValue *param, int numparam, VMRetu } ret->SetPointer(state, ATAG_STATE); return 1; - } // Find a state with any number of dots in its name.