diff options
Diffstat (limited to 'engines/sword25/gfx/screenshot.cpp')
-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; } |