From da4e791a3fd5d0ae41170963dba4cb4dd81cc859 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 28 Sep 2020 23:08:48 +0200 Subject: [PATCH] - delete the FraggleScript thinker in G_NewInit. If this isn't done it can later cause problems when being taken down by GC --- src/g_level.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/g_level.cpp b/src/g_level.cpp index a8cb2ae4b6..f2e8985989 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -91,6 +91,8 @@ #include "i_time.h" #include "p_maputl.h" #include "s_music.h" +#include "fragglescript/t_script.h" + #include "texturemanager.h" void STAT_StartNewGame(const char *lev); @@ -373,6 +375,8 @@ void G_NewInit () pawn->flags |= MF_NOSECTOR | MF_NOBLOCKMAP; pawn->Destroy(); } + if (primaryLevel->FraggleScriptThinker) primaryLevel->FraggleScriptThinker->Destroy(); + primaryLevel->FraggleScriptThinker = nullptr; G_ClearSnapshots (); netgame = false;