From 94d5d6848e696f45075aafd047fd0ca8a9cea0fe Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 31 Jan 2017 13:46:35 +0100 Subject: [PATCH] - moved all code that deletes some data from P_SetupLevel to P_FreeLevelData so that P_Shutdown can also call it. This is particularly important for camera textures which otherwise would not be taken down before a restart. --- src/p_setup.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index df41345f4..a4e4ef1b9 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3423,6 +3423,17 @@ extern polyblock_t **PolyBlockMap; void P_FreeLevelData () { + MapThingsConverted.Clear(); + MapThingsUserDataIndex.Clear(); + MapThingsUserData.Clear(); + linemap.Clear(); + FCanvasTextureInfo::EmptyList(); + R_FreePastViewers(); + P_ClearUDMFKeys(); + + // [RH] Clear all ThingID hash chains. + AActor::ClearTIDHashes(); + P_FreeMapDataBackup(); interpolator.ClearInterpolations(); // [RH] Nothing to interpolate on a fresh level. Renderer->CleanLevelData(); @@ -3575,14 +3586,6 @@ void P_SetupLevel (const char *lumpname, int position) level.maptype = MAPTYPE_UNKNOWN; wminfo.partime = 180; - MapThingsConverted.Clear(); - MapThingsUserDataIndex.Clear(); - MapThingsUserData.Clear(); - linemap.Clear(); - FCanvasTextureInfo::EmptyList (); - R_FreePastViewers (); - P_ClearUDMFKeys(); - if (!savegamerestore) { for (i = 0; i < MAXPLAYERS; ++i) @@ -3612,8 +3615,6 @@ void P_SetupLevel (const char *lumpname, int position) // Make sure all sounds are stopped before Z_FreeTags. S_Start (); - // [RH] Clear all ThingID hash chains. - AActor::ClearTIDHashes (); // [RH] clear out the mid-screen message C_MidPrint (NULL, NULL);