瀏覽代碼

Fix memory leak

--HG--
branch : minor
Alex Szpakowski 8 年之前
父節點
當前提交
12ede289b4
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/modules/image/Image.cpp

+ 2 - 2
src/modules/image/Image.cpp

@@ -125,12 +125,12 @@ std::vector<StrongRef<ImageData>> Image::newVolumeLayers(ImageData *src)
 	if (totalW % totalH == 0)
 	if (totalW % totalH == 0)
 	{
 	{
 		for (int i = 0; i < totalW / totalH; i++)
 		for (int i = 0; i < totalW / totalH; i++)
-			layers.emplace_back(newPastedImageData(src, i * totalH, 0, totalH, totalH));
+			layers.emplace_back(newPastedImageData(src, i * totalH, 0, totalH, totalH), Acquire::NORETAIN);
 	}
 	}
 	else if (totalH % totalW == 0)
 	else if (totalH % totalW == 0)
 	{
 	{
 		for (int i = 0; i < totalH / totalW; i++)
 		for (int i = 0; i < totalH / totalW; i++)
-			layers.emplace_back(newPastedImageData(src, 0, i * totalW, totalW, totalW));
+			layers.emplace_back(newPastedImageData(src, 0, i * totalW, totalW, totalW), Acquire::NORETAIN);
 	}
 	}
 	else
 	else
 		throw love::Exception("Cannot extract volume layers from source ImageData.");
 		throw love::Exception("Cannot extract volume layers from source ImageData.");