ZVISION: Fix leaking save / thumbnail MemoryWriteStreamDynamic buffers

This commit is contained in:
Bastien Bouclet 2017-09-20 19:29:05 +02:00
parent ddac55699d
commit 1b3cc08b75

View File

@ -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);
}