Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d31099f0 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "Call RefBase::destroy() when OBJECT_LIFETIME_* is not the default"

parents 3933bcd7 8561698c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -419,7 +419,8 @@ void RefBase::weakref_type::decWeak(const void* id)
    
    if ((impl->mFlags&OBJECT_LIFETIME_WEAK) != OBJECT_LIFETIME_WEAK) {
        if (impl->mStrong == INITIAL_STRONG_VALUE)
            delete impl->mBase;
            if (impl->mBase)
                impl->mBase->destroy();
        else {
            // LOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase);
            delete impl;
@@ -427,7 +428,8 @@ void RefBase::weakref_type::decWeak(const void* id)
    } else {
        impl->mBase->onLastWeakRef(id);
        if ((impl->mFlags&OBJECT_LIFETIME_FOREVER) != OBJECT_LIFETIME_FOREVER) {
            delete impl->mBase;
            if (impl->mBase)
                impl->mBase->destroy();
        }
    }
}