Cleanup of object destruction. No need to have a per-class destruction function. This was a legacy of the distant past when the classes did not have a common base.
diff --git a/graphics/java/android/renderscript/BaseObj.java b/graphics/java/android/renderscript/BaseObj.java
index f760035..eaeb401 100644
--- a/graphics/java/android/renderscript/BaseObj.java
+++ b/graphics/java/android/renderscript/BaseObj.java
@@ -61,9 +61,18 @@
{
if (!mDestroyed) {
Log.v(RenderScript.LOG_TAG,
- "Element finalized without having released the RS reference.");
+ getClass() + " finalized without having released the RS reference.");
}
super.finalize();
}
+
+ public void destroy() {
+ if(mDestroyed) {
+ throw new IllegalStateException("Object already destroyed.");
+ }
+ mDestroyed = true;
+ mRS.nObjDestroy(mID);
+ }
+
}