Implement OOB destroy method that can be called from the java finalizer removing the need to explicitly destroy objects.
This commit is contained in:
@@ -60,8 +60,13 @@ class BaseObj {
|
||||
protected void finalize() throws Throwable
|
||||
{
|
||||
if (!mDestroyed) {
|
||||
if(mID != 0) {
|
||||
mRS.nObjDestroyOOB(mID);
|
||||
}
|
||||
mID = 0;
|
||||
mDestroyed = true;
|
||||
Log.v(RenderScript.LOG_TAG,
|
||||
getClass() + " finalized without having released the RS reference.");
|
||||
getClass() + " auto finalizing object without having released the RS reference.");
|
||||
}
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user