From 1fed15efc29e4d875819006cb80f97447a20edc3 Mon Sep 17 00:00:00 2001 From: drfrag Date: Mon, 13 Jan 2020 13:53:19 +0100 Subject: [PATCH] - Fixed crash exiting from the iwad selector. --- src/d_main.cpp | 3 ++- src/p_setup.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 73dae50c5..af3ab95da 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1010,7 +1010,8 @@ void D_Display () void D_ErrorCleanup () { savegamerestore = false; - screen->Unlock (); + if (screen) + screen->Unlock (); bglobal.RemoveAllBots (true); D_QuitNetGame (); if (demorecording || demoplayback) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 28050288b..0e3400cb9 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3151,7 +3151,8 @@ void P_FreeLevelData () AActor::ClearTIDHashes(); interpolator.ClearInterpolations(); // [RH] Nothing to interpolate on a fresh level. - Renderer->CleanLevelData(); + if (Renderer) + Renderer->CleanLevelData(); FPolyObj::ClearAllSubsectorLinks(); // can't be done as part of the polyobj deletion process. SN_StopAllSequences (); DThinker::DestroyAllThinkers ();