From 08f9e05b15e34886ff37962dd73169c26033ffb7 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 11 Nov 2017 13:23:26 +0100 Subject: SWORD25: Fix leaking the save thumbnail surface --- engines/sword25/gfx/screenshot.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index c86a2fe1d5..0b496971fc 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -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(), -- cgit v1.2.3