am 4870c813: am 7d1a6c5c: Merge "Fix destruction issues relating to AllocationAdapter."

* commit '4870c813fe4a6fc7a176f22b5e7f96e9f7a4e469':
  Fix destruction issues relating to AllocationAdapter.
This commit is contained in:
Tim Murray
2014-02-14 23:56:57 +00:00
committed by Android Git Automerger
2 changed files with 2 additions and 2 deletions

View File

@@ -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;

View File

@@ -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();