From e42b688afa1937707c8620e652b67371c709c194 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 28 Apr 2015 23:37:04 +0200 Subject: [PATCH] - finally found the reason why the garbage collector went haywire after a restart: PClass::StaticShutdown set the PClass::bShutdown variable which disables much of the garbage collector. This needs to be cleared after successful cleanup. Restart works now, except for some random CCMDs being executed right afterward. - fixed incorrect variable init in A_Face* functions which was missed before. --- src/d_main.cpp | 3 ++- src/p_enemy.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 2107763e7..dad3e5712 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2652,7 +2652,7 @@ void D_DoomMain (void) ReleaseGlobalSymbols(); PClass::StaticShutdown(); - GC::FullGC(); // perform one final garbage collection before deleting the class data + GC::FullGC(); // perform one final garbage collection after shutdown for (DObject *obj = GC::Root; obj; obj = obj->ObjNext) { @@ -2660,6 +2660,7 @@ void D_DoomMain (void) } restart++; + PClass::bShutdown = false; } } while (1); diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 25b3c8767..640fef3fa 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2891,7 +2891,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceTarget) PARAM_ACTION_PROLOGUE; PARAM_ANGLE_OPT(max_turn) { max_turn = 0; } PARAM_ANGLE_OPT(max_pitch) { max_pitch = 270; } - PARAM_ANGLE_OPT(ang_offset) { max_turn = 0; } + PARAM_ANGLE_OPT(ang_offset) { ang_offset = 0; } PARAM_ANGLE_OPT(pitch_offset) { pitch_offset = 0; } PARAM_INT_OPT(flags) { flags = 0; } @@ -2904,7 +2904,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceMaster) PARAM_ACTION_PROLOGUE; PARAM_ANGLE_OPT(max_turn) { max_turn = 0; } PARAM_ANGLE_OPT(max_pitch) { max_pitch = 270; } - PARAM_ANGLE_OPT(ang_offset) { max_turn = 0; } + PARAM_ANGLE_OPT(ang_offset) { ang_offset = 0; } PARAM_ANGLE_OPT(pitch_offset) { pitch_offset = 0; } PARAM_INT_OPT(flags) { flags = 0; } @@ -2917,7 +2917,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceTracer) PARAM_ACTION_PROLOGUE; PARAM_ANGLE_OPT(max_turn) { max_turn = 0; } PARAM_ANGLE_OPT(max_pitch) { max_pitch = 270; } - PARAM_ANGLE_OPT(ang_offset) { max_turn = 0; } + PARAM_ANGLE_OPT(ang_offset) { ang_offset = 0; } PARAM_ANGLE_OPT(pitch_offset) { pitch_offset = 0; } PARAM_INT_OPT(flags) { flags = 0; }