diff --git a/libsearch/index/inotify-watch.cpp b/libsearch/index/inotify-watch.cpp index d28678c..a7f7ce7 100644 --- a/libsearch/index/inotify-watch.cpp +++ b/libsearch/index/inotify-watch.cpp @@ -225,7 +225,10 @@ void InotifyWatch::run() qDebug() << "Leave watch loop"; if(FileUtils::SearchMethod::DIRECTSEARCH == FileUtils::searchMethod) { 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); // fcntl(m_inotifyFd, F_SETFD, FD_CLOEXEC);