add the lock of the settings search.

This commit is contained in:
baijunjie 2021-12-28 14:56:41 +08:00 committed by iaom
parent 0244b8f29b
commit 91382784fd
1 changed files with 1 additions and 0 deletions

View File

@ -279,6 +279,7 @@ void SettingsMatch::matchDataMap(QString &key, QString &keyword, size_t uniqueSy
if (data.contains(keyword, Qt::CaseInsensitive)) { if (data.contains(keyword, Qt::CaseInsensitive)) {
createResultInfo(resultInfo, m_dataMap.value(key), key); createResultInfo(resultInfo, m_dataMap.value(key), key);
//判断是否为同一次搜索 //判断是否为同一次搜索
SettingsSearchPlugin::m_mutex.lock();
if (uniqueSymbol == SettingsSearchPlugin::m_uniqueSymbolForSettings) { if (uniqueSymbol == SettingsSearchPlugin::m_uniqueSymbolForSettings) {
searchResult->enqueue(resultInfo); searchResult->enqueue(resultInfo);
SettingsSearchPlugin::m_mutex.unlock(); SettingsSearchPlugin::m_mutex.unlock();