Improve renderscript context teardown. Track object in the system and then force their cleanup by releasing all user references once destroy context is called. Java layer will no longer send destroy notifications for objects garbage collected once a context is destroyed.
This commit is contained in:
@ -60,9 +60,10 @@ class BaseObj {
|
||||
protected void finalize() throws Throwable
|
||||
{
|
||||
if (!mDestroyed) {
|
||||
if(mID != 0) {
|
||||
if(mID != 0 && mRS.isAlive()) {
|
||||
mRS.nObjDestroyOOB(mID);
|
||||
}
|
||||
mRS = null;
|
||||
mID = 0;
|
||||
mDestroyed = true;
|
||||
Log.v(RenderScript.LOG_TAG,
|
||||
|
Reference in New Issue
Block a user