resolved conflicts for merge of 780d57b8 to klp-modular-dev
Change-Id: Idf2f939c25c342fff98da6b83be875d7708deba0
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -109,9 +109,21 @@ public class BaseObj {
|
||||
return mName;
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
if (!mDestroyed) {
|
||||
if(mID != 0 && mRS.isAlive()) {
|
||||
private void helpDestroy() {
|
||||
boolean shouldDestroy = false;
|
||||
synchronized(this) {
|
||||
if (!mDestroyed) {
|
||||
shouldDestroy = true;
|
||||
mDestroyed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldDestroy) {
|
||||
// must include nObjDestroy in the critical section
|
||||
ReentrantReadWriteLock.ReadLock rlock = mRS.mRWLock.readLock();
|
||||
rlock.lock();
|
||||
// AllocationAdapters are BaseObjs with an ID of 0 but should not be passed to nObjDestroy
|
||||
if(mRS.isAlive() && mID != 0) {
|
||||
mRS.nObjDestroy(mID);
|
||||
}
|
||||
mRS = null;
|
||||
|
||||
Reference in New Issue
Block a user