- don't crash when destroying incomplete textures.

This can happen during TEXTURES parsing in case of an error.
This commit is contained in:
Christoph Oelckers 2022-10-20 16:52:45 +02:00
parent b6c5232fea
commit 6ba4295136

View file

@ -96,8 +96,11 @@ void FGameTexture::Setup(FTexture *wrap)
FGameTexture::~FGameTexture()
{
FGameTexture* link = fileSystem.GetLinkedTexture(GetSourceLump());
if (link == this) fileSystem.SetLinkedTexture(GetSourceLump(), nullptr);
if (Base != nullptr)
{
FGameTexture* link = fileSystem.GetLinkedTexture(GetSourceLump());
if (link == this) fileSystem.SetLinkedTexture(GetSourceLump(), nullptr);
}
if (SoftwareTexture != nullptr)
{
delete SoftwareTexture;