浏览代码

Release memory

Johan Mattsson 2 年之前
父节点
当前提交
3c0a251f71
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Engine/source/gfx/bitmap/gBitmap.cpp

+ 2 - 0
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;