Add incUserRef() for ScriptGroup/ScriptKernelID/ScriptFieldID.
Bug: 8530206
This change also fixes a small bug in zeroUserRef(), where we mistakenly
decrement the zeroed out count.
Change-Id: I5097e59faad52291218657c10e99c598a00ad84b
diff --git a/rsObjectBase.cpp b/rsObjectBase.cpp
index 17064a5..f864bac 100644
--- a/rsObjectBase.cpp
+++ b/rsObjectBase.cpp
@@ -133,11 +133,8 @@
bool ObjectBase::zeroUserRef() const {
//ALOGV("ObjectBase %p zeroU ref %i, %i", this, mUserRefCount, mSysRefCount);
__sync_and_and_fetch(&mUserRefCount, 0);
- if ((__sync_fetch_and_sub(&mUserRefCount, 1) <= 1)) {
- __sync_synchronize();
- if (mSysRefCount <= 0) {
- return checkDelete(this);
- }
+ if (mSysRefCount <= 0) {
+ return checkDelete(this);
}
return false;
}