diff options
| author | lioncash <mathew1900@hotmail.com> | 2013-01-24 08:21:08 -0500 |
|---|---|---|
| committer | lioncash <mathew1900@hotmail.com> | 2013-01-24 08:21:08 -0500 |
| commit | 2db0c4270eda2e652bb39e394aa8a576785a2354 (patch) | |
| tree | 4622588e4e2f3634e1c879da11ef731c7a9e0a8f /Source/Core/Common/Src/FileUtil.cpp | |
| parent | f69b6b595ef80acf5ce776a80b1df27033bc7fdf (diff) | |
Fix a potential memory leak on non-windows systems.
Also added a FIXME to BPStructs.cpp and BPMemLoader.cpp
Diffstat (limited to 'Source/Core/Common/Src/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/Src/FileUtil.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index d7b248a722..d74c99b7a2 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -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 |
