From 00e9738778c940ce63ade88f6f4fd9dcb3f09ccf Mon Sep 17 00:00:00 2001 From: houchengqiu Date: Wed, 21 Feb 2024 10:52:03 +0800 Subject: [PATCH] fix: Fix the issue of m900 getting stuck Fix the issue of m900 getting stuck Log: Fix the issue of m900 getting stuck Bug: https://pms.uniontech.com/bug-view-236279.html --- deepin-system-monitor-main/process/process_set.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/deepin-system-monitor-main/process/process_set.cpp b/deepin-system-monitor-main/process/process_set.cpp index 78cefadb..7f58a4c5 100644 --- a/deepin-system-monitor-main/process/process_set.cpp +++ b/deepin-system-monitor-main/process/process_set.cpp @@ -244,8 +244,6 @@ const Process ProcessSet::getProcessById(pid_t pid) const QList ProcessSet::getPIDList() const { - const QVariant &vindex = m_settings->getOption(kSettingKeyProcessTabIndex, kFilterApps); - int index = vindex.toInt(); // 当系统读取到的m_set为空时,通过keys()函数返回会造成段错误 原因是keys函数效率低下,会造成大量的内存拷贝 // 替换方案是 QList pidList {}; @@ -254,11 +252,7 @@ QList ProcessSet::getPIDList() const QMap::key_iterator iterBegin = m_set.keyBegin(); for (;iterBegin != m_set.keyEnd(); ++iterBegin) { pid_t tmpKey = *iterBegin; - Process proc = m_set[tmpKey]; - if( ((kFilterApps == index) && (proc.appType()<= kFilterApps)) || - ((kFilterCurrentUser == index) && (proc.appType() <= kFilterCurrentUser)) || - (kNoFilter == index)) - pidList.append(tmpKey); + pidList.append(tmpKey); if (size != m_set.size()) break; }