diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 8aeca7b8b7..7ea4d9f154 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -255,6 +255,7 @@ void FLevelLocals::ClearPortals() void FLevelLocals::ClearLevelData() { + interpolator.ClearInterpolations(); // [RH] Nothing to interpolate on a fresh level. Thinkers.DestroyAllThinkers(); ClearAllSubsectorLinks(); // can't be done as part of the polyobj deletion process. @@ -290,10 +291,9 @@ void FLevelLocals::ClearLevelData() } ClearPortals(); - interpolator.ClearInterpolations(); // [RH] Nothing to interpolate on a fresh level. tagManager.Clear(); ClearTIDHashes(); - Behaviors.UnloadModules(); + if (SpotState) SpotState->Destroy(); SpotState = nullptr; ACSThinker = nullptr; FraggleScriptThinker = nullptr; diff --git a/src/r_data/r_interpolate.cpp b/src/r_data/r_interpolate.cpp index 874159c027..a5763627ed 100644 --- a/src/r_data/r_interpolate.cpp +++ b/src/r_data/r_interpolate.cpp @@ -429,6 +429,7 @@ void DSectorPlaneInterpolation::OnDestroy() { attached[i]->DelRef(); } + attached.Reset(); Super::OnDestroy(); }