mirror of
https://github.com/clangen/musikcube.git
synced 2024-10-02 04:52:32 +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 relPath8 = str::u16to8(findData.cFileName);
|
||||||
std::string fullPath8 = path + (hasTrailingSlash ? "" : "\\") + relPath8;
|
std::string fullPath8 = path + (hasTrailingSlash ? "" : "\\") + relPath8;
|
||||||
if (interrupt && interrupt()) {
|
if (interrupt && interrupt()) {
|
||||||
|
FindClose(handle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (findData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY) {
|
else if (findData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY) {
|
||||||
@ -181,6 +182,7 @@ namespace musik { namespace core { namespace sdk { namespace fs {
|
|||||||
|
|
||||||
while ((entry = readdir(dir)) != nullptr) {
|
while ((entry = readdir(dir)) != nullptr) {
|
||||||
if (interrupt && interrupt()) {
|
if (interrupt && interrupt()) {
|
||||||
|
closedir(dir);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user