From c9612b0cab0733da9e7863fbe0da539746a23a18 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 19 Feb 2024 10:16:36 +0100 Subject: [PATCH] Fix memory leak due to IHardwareTexture forward declaration --- src/common/textures/hw_texcontainer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/textures/hw_texcontainer.h b/src/common/textures/hw_texcontainer.h index a4ff33f93f..f75b02753c 100644 --- a/src/common/textures/hw_texcontainer.h +++ b/src/common/textures/hw_texcontainer.h @@ -3,9 +3,9 @@ #include "tarray.h" #include "hw_ihwtexture.h" #include "palettecontainer.h" +#include "hw_ihwtexture.h" // Note: this cannot be a forward declaration due to the inlined delete statement below. struct FTextureBuffer; -class IHardwareTexture; enum ECreateTexBufferFlags { @@ -34,7 +34,7 @@ private: void Delete() { - if (hwTexture) delete hwTexture; + delete hwTexture; hwTexture = nullptr; }