summaryrefslogtreecommitdiff
path: root/graphics/java/android/renderscript/BaseObj.java
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-08-18 14:14:24 -0700
committerJason Sams <rjsams@android.com>2009-08-18 14:20:07 -0700
commit7ce033d797e5df5e2131e2ed459fba181eaf4658 (patch)
treec4bf9fd7d74260b800b75786a2adbca04d2f71be /graphics/java/android/renderscript/BaseObj.java
parent48134b78d53eca2a0a71799b0901aba5997f2eba (diff)
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.
Diffstat (limited to 'graphics/java/android/renderscript/BaseObj.java')
-rw-r--r--graphics/java/android/renderscript/BaseObj.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/graphics/java/android/renderscript/BaseObj.java b/graphics/java/android/renderscript/BaseObj.java
index f760035819a2..eaeb40164e89 100644
--- a/graphics/java/android/renderscript/BaseObj.java
+++ b/graphics/java/android/renderscript/BaseObj.java
@@ -61,9 +61,18 @@ class BaseObj {
{
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);
+ }
+
}