From 37b06c3421925b28dccf7b254d6555463e1382ee Mon Sep 17 00:00:00 2001 From: JunjieBai Date: Thu, 20 Oct 2022 16:50:34 +0800 Subject: [PATCH] Solve the problem that the dir watcher's dbus crashed because of deadlock. --- ukui-search-service-dir-manager/dirwatcher/dir-watcher.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ukui-search-service-dir-manager/dirwatcher/dir-watcher.cpp b/ukui-search-service-dir-manager/dirwatcher/dir-watcher.cpp index 42b7695..fb39620 100644 --- a/ukui-search-service-dir-manager/dirwatcher/dir-watcher.cpp +++ b/ukui-search-service-dir-manager/dirwatcher/dir-watcher.cpp @@ -252,6 +252,7 @@ void DirWatcher::mountRemoveCallback(GVolumeMonitor *monitor, GMount *gmount, Di if (removedUri.startsWith("file:///")) { QString removedMountPoint = g_filename_from_uri(removedUri.toUtf8().constData(), nullptr, nullptr); pThis->m_blackListOfIndex.removeAll(removedMountPoint); + locker.unlock(); QStringList indexableDirList = pThis->currentIndexableDir(); //卸载目录下存在已索引目录时,通知索引服务删除对应目录 for (const QString &indexableDir : indexableDirList) { @@ -260,6 +261,7 @@ void DirWatcher::mountRemoveCallback(GVolumeMonitor *monitor, GMount *gmount, Di } } //处理子卷情况 + locker.relock(); for (auto t = pThis->m_infoOfSubvolume.constBegin(); t != pThis->m_infoOfSubvolume.constEnd(); t++) { if (removedMountPoint.startsWith(t.value() + "/")) { pThis->m_blackListOfIndex.removeAll(removedMountPoint.replace(t.value(), t.key()));