From 3c0a251f714e05a241010eed7e395ecafb18e357 Mon Sep 17 00:00:00 2001 From: Johan Mattsson <39247600+mjunix@users.noreply.github.com> Date: Sat, 4 Mar 2023 21:58:16 +0100 Subject: [PATCH] Release memory --- Engine/source/gfx/bitmap/gBitmap.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Engine/source/gfx/bitmap/gBitmap.cpp b/Engine/source/gfx/bitmap/gBitmap.cpp index 281ee7a5d..355bf7486 100644 --- a/Engine/source/gfx/bitmap/gBitmap.cpp +++ b/Engine/source/gfx/bitmap/gBitmap.cpp @@ -1436,6 +1436,7 @@ DefineEngineFunction(saveScaledImage, bool, (const char* bitmapSource, const cha if (!fs.open(destinationPath.getFullPath(), Torque::FS::File::Write)) { Con::errorf("saveScaledImage() - Failed to open output file '%s'!", bitmapDest); + delete image; return false; } else @@ -1443,6 +1444,7 @@ DefineEngineFunction(saveScaledImage, bool, (const char* bitmapSource, const cha image->writeBitmap("png", fs); fs.close(); + delete image; } return true;