From 59b41e51d0e864f8750889f5f79c2f47e9a6109e Mon Sep 17 00:00:00 2001 From: autumn330 Date: Tue, 30 Mar 2021 17:51:57 +0800 Subject: [PATCH] IssueNo:#I3E9S9 Description:Resolved the memory leak problem. Sig:aafwk Feature or Bugfix: Bugfix Binary Source: No --- services/abilitymgr_lite/src/ability_service.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/abilitymgr_lite/src/ability_service.cpp b/services/abilitymgr_lite/src/ability_service.cpp index f6004fe..41cf6e9 100755 --- a/services/abilitymgr_lite/src/ability_service.cpp +++ b/services/abilitymgr_lite/src/ability_service.cpp @@ -397,19 +397,21 @@ void AbilityService::OnBackgroundDone(uint16_t token) void AbilityService::OnDestroyDone(uint16_t token) { HILOG_INFO(HILOG_MODULE_AAFWK, "OnDestroyDone [%u]", token); - SetAbilityState(token, SCHEDULE_STOP); // 桌面不会destroy if (token == LAUNCHER_TOKEN) { + SetAbilityState(token, SCHEDULE_STOP); return; } auto topRecord = abilityStack_.GetTopAbility(); if ((topRecord == nullptr) || (topRecord->GetToken() != token)) { + SetAbilityState(token, SCHEDULE_STOP); DeleteRecordInfo(token); return; } APP_EVENT(MT_ACE_APP_STOP); abilityStack_.PopAbility(); DeleteRecordInfo(token); + SetAbilityState(token, SCHEDULE_STOP); // 无其他JS需要启动的场景,直接激活桌面 if (pendingToken_ == 0) { -- Gitee