aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2017-11-11 13:23:26 +0100
committerBastien Bouclet2017-11-11 13:26:22 +0100
commit08f9e05b15e34886ff37962dd73169c26033ffb7 (patch)
treee26dd8ddbbd917051a0967edcff51904cf3bd61f
parent1dbe3ad18ea235debd29192f79537264cd247bab (diff)
downloadscummvm-rg350-08f9e05b15e34886ff37962dd73169c26033ffb7.tar.gz
scummvm-rg350-08f9e05b15e34886ff37962dd73169c26033ffb7.tar.bz2
scummvm-rg350-08f9e05b15e34886ff37962dd73169c26033ffb7.zip
SWORD25: Fix leaking the save thumbnail surface
-rw-r--r--engines/sword25/gfx/screenshot.cpp1
1 files changed, 1 insertions, 0 deletions
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(),