diff options
Diffstat (limited to 'libs/rs/rsObjectBase.cpp')
-rw-r--r-- | libs/rs/rsObjectBase.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/rs/rsObjectBase.cpp b/libs/rs/rsObjectBase.cpp index 724172ee2039..44dc0425ea72 100644 --- a/libs/rs/rsObjectBase.cpp +++ b/libs/rs/rsObjectBase.cpp @@ -120,8 +120,15 @@ bool ObjectBase::checkDelete(const ObjectBase *ref) bool ObjectBase::decUserRef() const { - //LOGV("ObjectBase %p decU ref %i, %i", this, mUserRefCount, mSysRefCount); rsAssert(mUserRefCount > 0); +#if RS_OBJECT_DEBUG + LOGV("ObjectBase %p decU ref %i, %i", this, mUserRefCount, mSysRefCount); + if (mUserRefCount <= 0) { + mStack.dump(); + } +#endif + + if ((android_atomic_dec(&mUserRefCount) <= 1) && (android_atomic_acquire_load(&mSysRefCount) <= 0)) { return checkDelete(this); |