aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorBastien Bouclet2017-09-20 19:29:05 +0200
committerBastien Bouclet2017-09-22 07:06:20 +0200
commit1b3cc08b75c56a06cfa90edaf1b0da181d40ddcc (patch)
tree8d8c51a3e273fc9ffaf9b1912e557ff64bd3abd6 /engines/zvision
parentddac55699d69be8c02b724b413fb92d1a93b7257 (diff)
downloadscummvm-rg350-1b3cc08b75c56a06cfa90edaf1b0da181d40ddcc.tar.gz
scummvm-rg350-1b3cc08b75c56a06cfa90edaf1b0da181d40ddcc.tar.bz2
scummvm-rg350-1b3cc08b75c56a06cfa90edaf1b0da181d40ddcc.zip
ZVISION: Fix leaking save / thumbnail MemoryWriteStreamDynamic buffers
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/file/save_manager.cpp4
1 files changed, 2 insertions, 2 deletions
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);
}