Merge pull request #564 from lioncash/leak

file_system: Prevent resource leaks in DeleteDirectory()
pull/567/head
Connor McLaughlin 5 years ago committed by GitHub
commit 84d4423719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1027,13 +1027,19 @@ bool FileSystem::DeleteDirectory(const char* Path, bool Recursive)
{
// recurse into that
if (!DeleteDirectory(fileName, true))
{
FindClose(hFind);
return false;
}
}
else
{
// found a file, so delete it
if (!DeleteFileA(fileName))
{
FindClose(hFind);
return false;
}
}
} while (FindNextFileA(hFind, &findData));
FindClose(hFind);

Loading…
Cancel
Save