diff options
Diffstat (limited to 'graphics/java/android/renderscript/BaseObj.java')
-rw-r--r-- | graphics/java/android/renderscript/BaseObj.java | 11 |
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); + } + } |