From 6c7788d2adb1d8d42b81b1a12a02bcb3ae1eebee Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 29 Oct 2013 21:27:22 -0500 Subject: [PATCH] Make global symbols survive GC runs - The global symbol table was never marked by the GC, so anything pointed only by it was fair game to disappear. - Don't clear the global symbol table during DECORATE parsing. Junk in there should be considered constant after initialization. --- src/dobjgc.cpp | 2 ++ src/thingdef/thingdef.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dobjgc.cpp b/src/dobjgc.cpp index da3d28ac1..51b98eee4 100644 --- a/src/dobjgc.cpp +++ b/src/dobjgc.cpp @@ -370,6 +370,8 @@ static void MarkRoot() { Mark(PClass::AllClasses[i]); } + // Mark global symbols + GlobalSymbols.MarkSymbols(); // Mark bot stuff. Mark(bglobal.firstthing); Mark(bglobal.body1); diff --git a/src/thingdef/thingdef.cpp b/src/thingdef/thingdef.cpp index 8b93b7e54..0a02e2763 100644 --- a/src/thingdef/thingdef.cpp +++ b/src/thingdef/thingdef.cpp @@ -425,7 +425,6 @@ void LoadActors () timer.Reset(); timer.Clock(); ActorDamageFuncs.Clear(); - GlobalSymbols.ReleaseSymbols(); FScriptPosition::ResetErrorCounter(); InitThingdef(); lastlump = 0;