- fixed several Destroy methods which blanketly assumed that the object's pointers were valid to use without checks.

This is not the case if deserialization prematurely aborts. The entire object may be invalid if something in the deserializer I_Error's out.
This commit is contained in:
Christoph Oelckers 2016-09-23 08:49:30 +02:00
commit cad2be46ac
4 changed files with 57 additions and 34 deletions

View file

@ -116,13 +116,16 @@ void DBaseDecal::Destroy ()
void DBaseDecal::Remove ()
{
if (WallPrev == nullptr) Side->AttachedDecals = WallNext;
if (WallPrev == nullptr)
{
if (Side != nullptr) Side->AttachedDecals = WallNext;
}
else WallPrev->WallNext = WallNext;
if (WallNext != nullptr) WallNext->WallPrev = WallPrev;
WallPrev = NULL;
WallNext = NULL;
WallPrev = nullptr;
WallNext = nullptr;
}
void DBaseDecal::Serialize(FSerializer &arc)