!1699 clear reversed pid

Merge pull request !1699 from 杨浩/1112reverspid
This commit is contained in:
openharmony_ci 2024-11-14 01:52:58 +00:00 committed by Gitee
commit 6c9ad05a58
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -109,6 +109,14 @@ static void StopAppSpawn(void)
OH_ListInit(&appInfo->node);
free(appInfo);
}
AppSpawnContent *content = GetAppSpawnContent();
if (content != NULL && content->reservedPid > 0) {
int ret = kill(content->reservedPid, SIGKILL);
APPSPAWN_CHECK_ONLY_LOG(ret == 0, "kill reserved pid %{public}d failed %{public}d %{public}d",
content->reservedPid, ret, errno);
content->reservedPid = 0;
}
TraversalSpawnedProcess(AppQueueDestroyProc, NULL);
APPSPAWN_LOGI("StopAppSpawn ");
#ifdef APPSPAWN_HISYSEVENT