From b01fb9f3f32f3d61a6e0988988b303118719751f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 18 Feb 2016 10:19:59 +0100 Subject: WAGE: Plug memory leak --- engines/wage/world.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'engines/wage') diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp index 6c74911a86..63b77a5501 100644 --- a/engines/wage/world.cpp +++ b/engines/wage/world.cpp @@ -359,18 +359,17 @@ void World::loadExternalSounds(Common::String fname) { } in.close(); - Common::MacResManager *resMan; - resMan = new Common::MacResManager(); - resMan->open(fname); + Common::MacResManager resMan; + resMan.open(fname); Common::MacResIDArray resArray; Common::SeekableReadStream *res; Common::MacResIDArray::const_iterator iter; - resArray = resMan->getResIDArray(MKTAG('A','S','N','D')); + resArray = resMan.getResIDArray(MKTAG('A','S','N','D')); for (iter = resArray.begin(); iter != resArray.end(); ++iter) { - res = resMan->getResource(MKTAG('A','S','N','D'), *iter); - addSound(new Sound(resMan->getResName(MKTAG('A','S','N','D'), *iter), res)); + res = resMan.getResource(MKTAG('A','S','N','D'), *iter); + addSound(new Sound(resMan.getResName(MKTAG('A','S','N','D'), *iter), res)); } } -- cgit v1.2.3