修复索引关闭时取消监听不完全的问题。

This commit is contained in:
iaom 2022-04-09 17:32:25 +08:00
parent 539dd6529b
commit 1135c48abf
1 changed files with 4 additions and 1 deletions

View File

@ -225,7 +225,10 @@ void InotifyWatch::run()
qDebug() << "Leave watch loop"; qDebug() << "Leave watch loop";
if(FileUtils::SearchMethod::DIRECTSEARCH == FileUtils::searchMethod) { if(FileUtils::SearchMethod::DIRECTSEARCH == FileUtils::searchMethod) {
IndexStatusRecorder::getInstance()->setStatus(INOTIFY_NORMAL_EXIT, "3"); IndexStatusRecorder::getInstance()->setStatus(INOTIFY_NORMAL_EXIT, "3");
removeWatch(QStandardPaths::writableLocation(QStandardPaths::HomeLocation), false); for(QString path : currentPath) {
inotify_rm_watch(m_inotifyFd, currentPath.key(path));
}
currentPath.clear();
} }
close(m_inotifyFd); close(m_inotifyFd);
// fcntl(m_inotifyFd, F_SETFD, FD_CLOEXEC); // fcntl(m_inotifyFd, F_SETFD, FD_CLOEXEC);