mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Fix memory leak
--HG-- branch : minor
This commit is contained in:
@@ -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.");
|
||||||
|
|||||||
Reference in New Issue
Block a user