Fix a bunch of memory leaks, after enabling file+line-number memory leak tracking for the MS Debug CRT.

Few of these were serious, most were on-exit, but good to have a cleaner memory report after running.
This commit is contained in:
Henrik Rydgard
2016-02-10 15:36:10 +01:00
parent 33b85934cc
commit 35b6c7341b
27 changed files with 118 additions and 37 deletions
+5 -2
View File
@@ -287,10 +287,13 @@ void ISOFileSystem::ReadDirectory(u32 startsector, u32 dirsize, TreeEntry *root,
if (!restrictTree.empty())
doRecurse = level < restrictTree.size() && restrictTree[level] == e->name;
if (doRecurse)
if (doRecurse) {
ReadDirectory(dir.firstDataSector(), dir.dataLength(), e, level + 1);
else
} else {
// The entry is not kept, must free it.
delete e;
continue;
}
}
}
root->children.push_back(e);