diff options
author | Jason Sams <jsams@google.com> | 2014-03-13 01:17:49 -0700 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2014-03-13 01:17:49 -0700 |
commit | fc15f899b86aa39bd32e3d38a9f5369ee8f0e2c8 (patch) | |
tree | 5985fb31fb99ca2402f9cbc73fa5885ab1adb44d /graphics | |
parent | 632c915ce8675033bbb7d356239d16594b26dffb (diff) | |
download | frameworks_base-fc15f899b86aa39bd32e3d38a9f5369ee8f0e2c8.zip frameworks_base-fc15f899b86aa39bd32e3d38a9f5369ee8f0e2c8.tar.gz frameworks_base-fc15f899b86aa39bd32e3d38a9f5369ee8f0e2c8.tar.bz2 |
Fix build issues from bad merge
Change-Id: I6ebac7c87b807a8ed2fbeac895c1db8b199f715a
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/renderscript/BaseObj.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/graphics/java/android/renderscript/BaseObj.java b/graphics/java/android/renderscript/BaseObj.java index 9723943..fc54532 100644 --- a/graphics/java/android/renderscript/BaseObj.java +++ b/graphics/java/android/renderscript/BaseObj.java @@ -16,7 +16,7 @@ package android.renderscript; -import android.util.Log; +import java.util.concurrent.locks.ReentrantReadWriteLock; /** * BaseObj is the base class for all RenderScript objects owned by a RS context. @@ -126,12 +126,14 @@ public class BaseObj { if(mRS.isAlive() && mID != 0) { mRS.nObjDestroy(mID); } + rlock.unlock(); mRS = null; mID = 0; - mDestroyed = true; - //Log.v(RenderScript.LOG_TAG, getClass() + - // " auto finalizing object without having released the RS reference."); } + } + + protected void finalize() throws Throwable { + helpDestroy(); super.finalize(); } @@ -140,12 +142,11 @@ public class BaseObj { * primary use is to force immediate cleanup of resources when it is * believed the GC will not respond quickly enough. */ - synchronized public void destroy() { + public void destroy() { if(mDestroyed) { throw new RSInvalidStateException("Object already destroyed."); } - mDestroyed = true; - mRS.nObjDestroy(mID); + helpDestroy(); } /** |