From 884223d9b84582e3f5c9e85ce8da760261a9744c Mon Sep 17 00:00:00 2001 From: sty28558 Date: Wed, 3 Sep 2025 11:42:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E6=89=BE=E4=B8=BB=E6=8E=A7=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E4=BC=98=E5=8C=96-=E5=90=8C=E6=AD=A5=E5=95=86?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sty28558 Change-Id: I50053cb491d88bc276111392432dd7741575b29d --- services/appmgr/src/app_running_manager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/appmgr/src/app_running_manager.cpp b/services/appmgr/src/app_running_manager.cpp index fe90a571111..aebb122ee0c 100644 --- a/services/appmgr/src/app_running_manager.cpp +++ b/services/appmgr/src/app_running_manager.cpp @@ -285,6 +285,9 @@ std::shared_ptr AppRunningManager::FindMasterProcessAppRunning if (!(appRecord && appRecord->GetUid() == uid)) { continue; } + if (!IsAppRunningRecordValid(appRecord)) { + continue; + } if (appRecord->IsMasterProcess() && IsSameAbilityType(appRecord, abilityInfo)) { resMasterRecord = appRecord; break; @@ -302,13 +305,12 @@ std::shared_ptr AppRunningManager::FindMasterProcessAppRunning } resMasterRecord = (resMasterRecord == nullptr && maxAppRecord != nullptr) ? maxAppRecord : resMasterRecord; resMasterRecord = (resMasterRecord == nullptr) ? minAppRecord : resMasterRecord; - if (IsAppRunningRecordValid(resMasterRecord)) { + if (resMasterRecord) { resMasterRecord->SetMasterProcess(true); resMasterRecord->SetTimeStamp(0); DelayedSingleton::GetInstance()->ReuseCachedProcess(resMasterRecord); - return resMasterRecord; } - return nullptr; + return resMasterRecord; } bool AppRunningManager::CheckMasterProcessAppRunningRecordIsExist( -- Gitee