- 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); _CrtSetDbgFlag (_CrtSetDbgFlag(0) | _CRTDBG_LEAK_CHECK_DF);
// Use this to break at a specific allocation number. // Use this to break at a specific allocation number.
//_crtBreakAlloc = 227524; //_crtBreakAlloc = 291757;
#endif #endif
int ret = DoMain (hInstance); int ret = DoMain (hInstance);

View file

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

View file

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