Fix a potential memory leak on non-windows systems.

Also added a FIXME to BPStructs.cpp and BPMemLoader.cpp
This commit is contained in:
lioncash
2013-01-24 08:21:08 -05:00
parent f69b6b595e
commit 2db0c4270e
3 changed files with 14 additions and 0 deletions

View File

@ -512,12 +512,24 @@ bool DeleteDirRecursively(const std::string &directory)
if (IsDirectory(newPath))
{
if (!DeleteDirRecursively(newPath))
{
#ifndef _WIN32
closedir(dirp);
#endif
return false;
}
}
else
{
if (!File::Delete(newPath))
{
#ifndef _WIN32
closedir(dirp);
#endif
return false;
}
}
#ifdef _WIN32