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:
Jason Sams
2009-09-25 14:51:22 -07:00
parent a0cad2f5d1
commit a9e7a05b84
43 changed files with 259 additions and 104 deletions

View File

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