Loading libs/utils/RefBase.cpp +11 −9 Original line number Original line Diff line number Diff line Loading @@ -373,21 +373,23 @@ void RefBase::weakref_type::decWeak(const void* id) if (c != 1) return; if (c != 1) return; if ((impl->mFlags&OBJECT_LIFETIME_WEAK) != OBJECT_LIFETIME_WEAK) { if ((impl->mFlags&OBJECT_LIFETIME_WEAK) != OBJECT_LIFETIME_WEAK) { if (impl->mStrong == INITIAL_STRONG_VALUE) if (impl->mStrong == INITIAL_STRONG_VALUE) { if (impl->mBase) if (impl->mBase) { impl->mBase->destroy(); impl->mBase->destroy(); else { } } else { // LOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase); // LOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase); delete impl; delete impl; } } } else { } else { impl->mBase->onLastWeakRef(id); impl->mBase->onLastWeakRef(id); if ((impl->mFlags&OBJECT_LIFETIME_FOREVER) != OBJECT_LIFETIME_FOREVER) { if ((impl->mFlags&OBJECT_LIFETIME_FOREVER) != OBJECT_LIFETIME_FOREVER) { if (impl->mBase) if (impl->mBase) { impl->mBase->destroy(); impl->mBase->destroy(); } } } } } } } bool RefBase::weakref_type::attemptIncStrong(const void* id) bool RefBase::weakref_type::attemptIncStrong(const void* id) { { Loading Loading @@ -508,12 +510,12 @@ RefBase::RefBase() RefBase::~RefBase() RefBase::~RefBase() { { // LOGV("Destroying RefBase %p (refs %p)\n", this, mRefs); if ((mRefs->mFlags & OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_WEAK) { if (mRefs->mWeak == 0) { if (mRefs->mWeak == 0) { // LOGV("Freeing refs %p of old RefBase %p\n", mRefs, this); delete mRefs; delete mRefs; } } } } } void RefBase::extendObjectLifetime(int32_t mode) void RefBase::extendObjectLifetime(int32_t mode) { { Loading Loading
libs/utils/RefBase.cpp +11 −9 Original line number Original line Diff line number Diff line Loading @@ -373,21 +373,23 @@ void RefBase::weakref_type::decWeak(const void* id) if (c != 1) return; if (c != 1) return; if ((impl->mFlags&OBJECT_LIFETIME_WEAK) != OBJECT_LIFETIME_WEAK) { if ((impl->mFlags&OBJECT_LIFETIME_WEAK) != OBJECT_LIFETIME_WEAK) { if (impl->mStrong == INITIAL_STRONG_VALUE) if (impl->mStrong == INITIAL_STRONG_VALUE) { if (impl->mBase) if (impl->mBase) { impl->mBase->destroy(); impl->mBase->destroy(); else { } } else { // LOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase); // LOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase); delete impl; delete impl; } } } else { } else { impl->mBase->onLastWeakRef(id); impl->mBase->onLastWeakRef(id); if ((impl->mFlags&OBJECT_LIFETIME_FOREVER) != OBJECT_LIFETIME_FOREVER) { if ((impl->mFlags&OBJECT_LIFETIME_FOREVER) != OBJECT_LIFETIME_FOREVER) { if (impl->mBase) if (impl->mBase) { impl->mBase->destroy(); impl->mBase->destroy(); } } } } } } } bool RefBase::weakref_type::attemptIncStrong(const void* id) bool RefBase::weakref_type::attemptIncStrong(const void* id) { { Loading Loading @@ -508,12 +510,12 @@ RefBase::RefBase() RefBase::~RefBase() RefBase::~RefBase() { { // LOGV("Destroying RefBase %p (refs %p)\n", this, mRefs); if ((mRefs->mFlags & OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_WEAK) { if (mRefs->mWeak == 0) { if (mRefs->mWeak == 0) { // LOGV("Freeing refs %p of old RefBase %p\n", mRefs, this); delete mRefs; delete mRefs; } } } } } void RefBase::extendObjectLifetime(int32_t mode) void RefBase::extendObjectLifetime(int32_t mode) { { Loading