From d4ac79760272d44843d2f10c02237a38f4a8d74e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 2 Jan 2020 13:40:14 +0200 Subject: [PATCH] - made load game failure a bit more resilient https://www.doomworld.com/forum/topic/111069-savestate-problems-with-gzdoom/ --- src/events.cpp | 3 ++- src/r_data/r_interpolate.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/events.cpp b/src/events.cpp index 2aac848a6..eafefb09e 100755 --- a/src/events.cpp +++ b/src/events.cpp @@ -1264,7 +1264,8 @@ void DStaticEventHandler::NewGame() // void DStaticEventHandler::OnDestroy() { - owner->UnregisterHandler(this); + if (owner) + owner->UnregisterHandler(this); Super::OnDestroy(); } diff --git a/src/r_data/r_interpolate.cpp b/src/r_data/r_interpolate.cpp index 6517eb283..ed9c7f58a 100644 --- a/src/r_data/r_interpolate.cpp +++ b/src/r_data/r_interpolate.cpp @@ -355,7 +355,8 @@ int DInterpolation::DelRef(bool force) void DInterpolation::UnlinkFromMap() { - Level->interpolator.RemoveInterpolation(this); + if (Level) + Level->interpolator.RemoveInterpolation(this); refcount = 0; }