- made load game failure a bit more resilient

https://www.doomworld.com/forum/topic/111069-savestate-problems-with-gzdoom/
This commit is contained in:
alexey.lysiuk 2020-01-02 13:40:14 +02:00
parent f2bacd5faf
commit d4ac797602
2 changed files with 4 additions and 2 deletions

View file

@ -1264,7 +1264,8 @@ void DStaticEventHandler::NewGame()
//
void DStaticEventHandler::OnDestroy()
{
owner->UnregisterHandler(this);
if (owner)
owner->UnregisterHandler(this);
Super::OnDestroy();
}

View file

@ -355,7 +355,8 @@ int DInterpolation::DelRef(bool force)
void DInterpolation::UnlinkFromMap()
{
Level->interpolator.RemoveInterpolation(this);
if (Level)
Level->interpolator.RemoveInterpolation(this);
refcount = 0;
}