From fff5326593e8fe7f17efea3348f87eaaec53ce68 Mon Sep 17 00:00:00 2001 From: chenkeyu Date: Wed, 21 Aug 2024 17:21:10 +0800 Subject: [PATCH] Add log to verify refbase object address Issue:https://gitee.com/openharmony/communication_ipc/issues/IALJNX?from=project-issue Signed-off-by: chenkeyu --- base/src/refbase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base/src/refbase.cpp b/base/src/refbase.cpp index ffeed57..317c450 100644 --- a/base/src/refbase.cpp +++ b/base/src/refbase.cpp @@ -14,8 +14,8 @@ */ #include "refbase.h" -#ifdef DEBUG_REFBASE #include "utils_log.h" +#ifdef DEBUG_REFBASE #include #endif @@ -426,6 +426,7 @@ RefBase::RefBase(const RefBase &) void RefBase::RefPtrCallback() { + UTILS_LOGE("RefBase delete addr: %{public}p", this); delete this; } @@ -529,6 +530,7 @@ void RefBase::DecStrongRef(const void *objectId) const int curCount = refs->DecStrongRefCount(objectId); if (curCount == 1) { OnLastStrongRef(objectId); + UTILS_LOGE("RefBase curCount=1 addr: %{public}p", this); if (!refs->IsLifeTimeExtended()) { if (refs->callback_) { refs->callback_(); -- Gitee