diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index 36aa3dcc35893023dafef9a5c7127cc60485b853..bb85251c6634fe7809cb8f19fab5c0f985e1a3ee 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -110,6 +110,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