- properly delete backing images in the texture manager.

Although the images themselves are automatically taken down, any memory they allocate is not - and some of the special tile classes do need dynamic storage.
This commit is contained in:
Christoph Oelckers 2020-10-15 20:10:52 +02:00
parent 4f7c0b696c
commit 197a5f642a
3 changed files with 7 additions and 1 deletions

View File

@ -1242,7 +1242,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int
_CrtSetDbgFlag (_CrtSetDbgFlag(0) | _CRTDBG_LEAK_CHECK_DF);
// Use this to break at a specific allocation number.
//_crtBreakAlloc = 227524;
//_crtBreakAlloc = 291757;
#endif
int ret = DoMain (hInstance);

View File

@ -57,6 +57,11 @@ FImageTexture::FImageTexture(FImageSource *img) noexcept
}
}
FImageTexture::~FImageTexture()
{
delete mImage;
}
void FImageTexture::SetFromImage()
{
auto img = mImage;

View File

@ -357,6 +357,7 @@ protected:
void SetFromImage();
public:
FImageTexture(FImageSource* image) noexcept;
~FImageTexture();
TArray<uint8_t> Get8BitPixels(bool alphatex) override;
void SetImage(FImageSource* img)