Release memory

This commit is contained in:
Johan Mattsson 2023-03-04 21:58:16 +01:00 committed by GitHub
parent 390be98140
commit 3c0a251f71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;