diff --git a/ipc/native/c/ipc/src/liteos_a/ipc_invoker.c b/ipc/native/c/ipc/src/liteos_a/ipc_invoker.c index 623ce014fe2f35e9ede4a2afebecbc82da99fa7c..47a570a9b89adb6ccda4bafe7a0c46a274c67e7d 100644 --- a/ipc/native/c/ipc/src/liteos_a/ipc_invoker.c +++ b/ipc/native/c/ipc/src/liteos_a/ipc_invoker.c @@ -339,6 +339,7 @@ static void GetDeathCallback(IpcMsg* msg, HdlerArg* arg) return; } arg->msg = msg; + arg->num = MAX_DEATH_CALLBACK_NUM; (void)pthread_mutex_unlock(&g_ipcCallback.mutex); } diff --git a/ipc/native/c/manager/src/ipc_process_skeleton.c b/ipc/native/c/manager/src/ipc_process_skeleton.c index 1890443209cb211fd1b41b61b71961beda2cf711..0b9b4afb8fb4bfc14ef90ec739e2bdc63f14d6ab 100644 --- a/ipc/native/c/manager/src/ipc_process_skeleton.c +++ b/ipc/native/c/manager/src/ipc_process_skeleton.c @@ -423,6 +423,20 @@ void DeleteDeathCallback(DeathCallback *deathCallback) free(deathCallback); } +static void DeleteAllNode(void) +{ + (void)pthread_mutex_lock(&g_ipcSkeleton->lock); + DeathCallback *node = NULL; + DeathCallback *next = NULL; + UTILS_DL_LIST_FOR_EACH_ENTRY_SAFE(node, next, &g_ipcSkeleton->objects, DeathCallback, list) + { + pthread_mutex_destroy(&node->lock); + UtilsListDelete(&node->list); + free(node); + } + pthread_mutex_unlock(&g_ipcSkeleton->lock); +} + void ResetIpc(void) { RPC_LOG_INFO("ResetIpc called"); @@ -430,6 +444,7 @@ void ResetIpc(void) if (invoker != NULL && invoker->InvokerResetIpc != NULL) { (invoker->InvokerResetIpc)(); } + DeleteAllNode(); #ifdef IPC_RESET_SKELETON DeleteIpcSkeleton(g_ipcSkeleton); g_ipcSkeleton = NULL;