mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
Fixed memory leak when interrupting fs::scanDirectory
This commit is contained in:
parent
6553039933
commit
48a15ed1f1
@ -158,6 +158,7 @@ namespace musik { namespace core { namespace sdk { namespace fs {
|
||||
std::string relPath8 = str::u16to8(findData.cFileName);
|
||||
std::string fullPath8 = path + (hasTrailingSlash ? "" : "\\") + relPath8;
|
||||
if (interrupt && interrupt()) {
|
||||
FindClose(handle);
|
||||
return;
|
||||
}
|
||||
else if (findData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY) {
|
||||
@ -181,6 +182,7 @@ namespace musik { namespace core { namespace sdk { namespace fs {
|
||||
|
||||
while ((entry = readdir(dir)) != nullptr) {
|
||||
if (interrupt && interrupt()) {
|
||||
closedir(dir);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user