diff options
Diffstat (limited to 'rs/java/android/renderscript/BaseObj.java')
-rw-r--r-- | rs/java/android/renderscript/BaseObj.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rs/java/android/renderscript/BaseObj.java b/rs/java/android/renderscript/BaseObj.java index 842aa23..b386dd7 100644 --- a/rs/java/android/renderscript/BaseObj.java +++ b/rs/java/android/renderscript/BaseObj.java @@ -122,7 +122,8 @@ public class BaseObj { // must include nObjDestroy in the critical section ReentrantReadWriteLock.ReadLock rlock = mRS.mRWLock.readLock(); rlock.lock(); - if(mRS.isAlive()) { + // AllocationAdapters are BaseObjs with an ID of 0 but should not be passed to nObjDestroy + if(mRS.isAlive() && mID != 0) { mRS.nObjDestroy(mID); } rlock.unlock(); |