From 6d63c84f443b2dcc573cac69f234b3d52493d7b1 Mon Sep 17 00:00:00 2001 From: Tim Murray Date: Wed, 12 Feb 2014 11:16:17 -0800 Subject: Fix destruction issues relating to AllocationAdapter. bug 12971201 Change-Id: I3d9f66f527a35837ac866a695bdcc41d908a2562 --- rs/java/android/renderscript/AllocationAdapter.java | 1 - rs/java/android/renderscript/BaseObj.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'rs') diff --git a/rs/java/android/renderscript/AllocationAdapter.java b/rs/java/android/renderscript/AllocationAdapter.java index b77d087..fd20cae 100644 --- a/rs/java/android/renderscript/AllocationAdapter.java +++ b/rs/java/android/renderscript/AllocationAdapter.java @@ -224,7 +224,6 @@ public class AllocationAdapter extends Allocation { } static public AllocationAdapter create2D(RenderScript rs, Allocation a) { - android.util.Log.e("rs", "create2d " + a); rs.validate(); AllocationAdapter aa = new AllocationAdapter(0, rs, a); aa.mConstrainedLOD = true; 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(); -- cgit v1.1