SWORD25: Fix leaking the save thumbnail surface

This commit is contained in:
Bastien Bouclet 2017-11-11 13:23:26 +01:00
parent 1dbe3ad18e
commit 08f9e05b15

View File

@ -115,6 +115,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data)
// Create a PNG representation of the thumbnail data
Common::MemoryWriteStreamDynamic stream(DisposeAfterUse::NO);
saveToFile(&thumbnail, &stream);
thumbnail.free();
// Output a MemoryReadStream that encompasses the written data
Common::SeekableReadStream *result = new Common::MemoryReadStream(stream.getData(), stream.size(),