From 483fff04f67cd48a74ca3f90c87649d4f38649aa Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 12 Dec 2016 22:49:40 +0100 Subject: FULLPIPE: Plug more memory leaks --- engines/fullpipe/gfx.cpp | 3 +++ engines/fullpipe/statesaver.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index e46ab93e14..145f4e87b1 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -45,6 +45,9 @@ Background::Background() { } Background::~Background() { + for (uint i = 1; i < _picObjList.size(); i++) + delete _picObjList[i]; + _picObjList.clear(); for (int i = 0; i < _bigPictureArray1Count; i++) { diff --git a/engines/fullpipe/statesaver.cpp b/engines/fullpipe/statesaver.cpp index 7fb56f0479..5eb08fe213 100644 --- a/engines/fullpipe/statesaver.cpp +++ b/engines/fullpipe/statesaver.cpp @@ -55,7 +55,7 @@ bool GameLoader::writeSavegame(Scene *sc, const char *fname) { header.updateCounter = _updateCounter; header.unkField = 1; - Common::MemoryWriteStreamDynamic stream; + Common::MemoryWriteStreamDynamic stream(DisposeAfterUse::YES); MfcArchive *archive = new MfcArchive(&stream); -- cgit v1.2.3