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