From 7cb2c17df66a37bd6bed37d9fa6113502275ed2a Mon Sep 17 00:00:00 2001 From: yueyan Date: Thu, 4 Sep 2025 16:22:10 +0800 Subject: [PATCH] fix:print log when sending obituary Signed-off-by: yueyan --- .../core/framework/source/ipc_object_proxy.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ipc/native/src/core/framework/source/ipc_object_proxy.cpp b/ipc/native/src/core/framework/source/ipc_object_proxy.cpp index ca4f832a..ddd0261a 100644 --- a/ipc/native/src/core/framework/source/ipc_object_proxy.cpp +++ b/ipc/native/src/core/framework/source/ipc_object_proxy.cpp @@ -545,12 +545,16 @@ bool IPCObjectProxy::RemoveDeathRecipient(const sptr &recipient) // LCOV_EXCL_START void IPCObjectProxy::SendObituary() { + std::vector> toBeReport; + { + std::lock_guard lock(mutex_); + toBeReport.swap(recipients_); + } { std::shared_lock lockGuard(descMutex_); - ZLOGD(LABEL, "handle:%{public}d desc:%{public}s %{public}u", handle_, - remoteDescriptor_.c_str(), ProcessSkeleton::ConvertAddr(this)); + ZLOGI(LABEL, "handle:%{public}d desc:%{public}s %{public}u count:%{public}zu", handle_, + remoteDescriptor_.c_str(), ProcessSkeleton::ConvertAddr(this), toBeReport.size()); } - #ifndef CONFIG_IPC_SINGLE if (handle_ < IPCProcessSkeleton::DBINDER_HANDLE_BASE) { if (proto_ == IRemoteObject::IF_PROT_DATABUS || proto_ == IRemoteObject::IF_PROT_ERROR) { @@ -559,12 +563,6 @@ void IPCObjectProxy::SendObituary() } #endif SetObjectDied(true); - std::vector> toBeReport; - { - std::lock_guard lock(mutex_); - toBeReport.swap(recipients_); - } - if (toBeReport.size() > 0 && handle_ < IPCProcessSkeleton::DBINDER_HANDLE_BASE) { IRemoteInvoker *invoker = IPCThreadSkeleton::GetDefaultInvoker(); if (invoker != nullptr) { -- Gitee