From 1b3cc08b75c56a06cfa90edaf1b0da181d40ddcc Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Wed, 20 Sep 2017 19:29:05 +0200 Subject: ZVISION: Fix leaking save / thumbnail MemoryWriteStreamDynamic buffers --- engines/zvision/file/save_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/zvision') diff --git a/engines/zvision/file/save_manager.cpp b/engines/zvision/file/save_manager.cpp index 8a78e988b3..4259937a3b 100644 --- a/engines/zvision/file/save_manager.cpp +++ b/engines/zvision/file/save_manager.cpp @@ -273,11 +273,11 @@ Common::SeekableReadStream *SaveManager::getSlotFile(uint slot) { void SaveManager::prepareSaveBuffer() { delete _tempThumbnail; - _tempThumbnail = new Common::MemoryWriteStreamDynamic; + _tempThumbnail = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES); Graphics::saveThumbnail(*_tempThumbnail); delete _tempSave; - _tempSave = new Common::MemoryWriteStreamDynamic; + _tempSave = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES); _engine->getScriptManager()->serialize(_tempSave); } -- cgit v1.2.3