diff --git a/src/core/sdk/Filesystem.h b/src/core/sdk/Filesystem.h index c264cb3e5..3b3dac61e 100644 --- a/src/core/sdk/Filesystem.h +++ b/src/core/sdk/Filesystem.h @@ -191,6 +191,7 @@ namespace musik { namespace core { namespace sdk { namespace fs { struct stat info = {0}; if (stat(fn.c_str(), &info) < 0) { + closedir(dir); return; } if (S_ISDIR(info.st_mode)) { diff --git a/src/plugins/gmedecoder/GmeIndexerSource.cpp b/src/plugins/gmedecoder/GmeIndexerSource.cpp index 03b26c906..f50f97d54 100644 --- a/src/plugins/gmedecoder/GmeIndexerSource.cpp +++ b/src/plugins/gmedecoder/GmeIndexerSource.cpp @@ -96,7 +96,9 @@ ScanResult GmeIndexerSource::Scan( }; for (auto& path : this->paths) { - fs::scanDirectory(std::string(path), checkFile, checkInterrupt); + if (!this->interrupt) { + fs::scanDirectory(std::string(path), checkFile, checkInterrupt); + } } indexer->CommitProgress(this, this->filesIndexed); diff --git a/src/plugins/libopenmptdecoder/OpenMptIndexerSource.cpp b/src/plugins/libopenmptdecoder/OpenMptIndexerSource.cpp index 17042042f..d3f20f89e 100644 --- a/src/plugins/libopenmptdecoder/OpenMptIndexerSource.cpp +++ b/src/plugins/libopenmptdecoder/OpenMptIndexerSource.cpp @@ -101,7 +101,9 @@ ScanResult OpenMptIndexerSource::Scan( }; for (auto& path : this->paths) { - fs::scanDirectory(std::string(path), checkFile, checkInterrupt); + if (!this->interrupt) { + fs::scanDirectory(std::string(path), checkFile, checkInterrupt); + } } indexer->CommitProgress(this, this->filesIndexed);