Skip to content

Commit

Permalink
WAGE: Plug memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Feb 18, 2016
1 parent a2dcddc commit b01fb9f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions engines/wage/world.cpp
Expand Up @@ -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));
}
}

Expand Down

0 comments on commit b01fb9f

Please sign in to comment.