diff options
author | Bastien Bouclet | 2017-09-20 19:20:14 +0200 |
---|---|---|
committer | Bastien Bouclet | 2017-09-22 07:06:20 +0200 |
commit | 9c2cfee4e53f5e678d37b33cdcb354782932b10c (patch) | |
tree | 60cd8cd5c9dab9e88b84b88a2dd057fe1f922353 /engines/sword25 | |
parent | c3bff7f25a24c549885b8e402fb499b0dd48b9cd (diff) | |
download | scummvm-rg350-9c2cfee4e53f5e678d37b33cdcb354782932b10c.tar.gz scummvm-rg350-9c2cfee4e53f5e678d37b33cdcb354782932b10c.tar.bz2 scummvm-rg350-9c2cfee4e53f5e678d37b33cdcb354782932b10c.zip |
SWORD25: Fix leaking the save thumbnail MemoryWriteStreamDynamic
Diffstat (limited to 'engines/sword25')
-rw-r--r-- | engines/sword25/gfx/screenshot.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index eeaece97f2..c86a2fe1d5 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -113,11 +113,11 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) } // Create a PNG representation of the thumbnail data - Common::MemoryWriteStreamDynamic *stream = new Common::MemoryWriteStreamDynamic(); - saveToFile(&thumbnail, stream); + Common::MemoryWriteStreamDynamic stream(DisposeAfterUse::NO); + saveToFile(&thumbnail, &stream); // Output a MemoryReadStream that encompasses the written data - Common::SeekableReadStream *result = new Common::MemoryReadStream(stream->getData(), stream->size(), + Common::SeekableReadStream *result = new Common::MemoryReadStream(stream.getData(), stream.size(), DisposeAfterUse::YES); return result; } |