Merge "Fix destruction issues relating to AllocationAdapter."
This commit is contained in:
@ -224,7 +224,6 @@ public class AllocationAdapter extends Allocation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static public AllocationAdapter create2D(RenderScript rs, Allocation a) {
|
static public AllocationAdapter create2D(RenderScript rs, Allocation a) {
|
||||||
android.util.Log.e("rs", "create2d " + a);
|
|
||||||
rs.validate();
|
rs.validate();
|
||||||
AllocationAdapter aa = new AllocationAdapter(0, rs, a);
|
AllocationAdapter aa = new AllocationAdapter(0, rs, a);
|
||||||
aa.mConstrainedLOD = true;
|
aa.mConstrainedLOD = true;
|
||||||
|
@ -122,7 +122,8 @@ public class BaseObj {
|
|||||||
// must include nObjDestroy in the critical section
|
// must include nObjDestroy in the critical section
|
||||||
ReentrantReadWriteLock.ReadLock rlock = mRS.mRWLock.readLock();
|
ReentrantReadWriteLock.ReadLock rlock = mRS.mRWLock.readLock();
|
||||||
rlock.lock();
|
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);
|
mRS.nObjDestroy(mID);
|
||||||
}
|
}
|
||||||
rlock.unlock();
|
rlock.unlock();
|
||||||
|
Reference in New Issue
Block a user