summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ScriptGroup.java
diff options
context:
space:
mode:
Diffstat (limited to 'rs/java/android/renderscript/ScriptGroup.java')
-rw-r--r--rs/java/android/renderscript/ScriptGroup.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/rs/java/android/renderscript/ScriptGroup.java b/rs/java/android/renderscript/ScriptGroup.java
index 0d10c6d9dc50..e0bdbfcdfed5 100644
--- a/rs/java/android/renderscript/ScriptGroup.java
+++ b/rs/java/android/renderscript/ScriptGroup.java
@@ -1066,19 +1066,12 @@ public final class ScriptGroup extends BaseObj {
*/
public void destroy() {
super.destroy();
- for(Closure c : mClosures) {
- c.destroy();
- }
- }
-
- protected void finalize() throws Throwable {
- // Clear out the list mClosures to avoid double-destroying the closures,
- // in case their finalizers race ahead.
+ // ScriptGroup created using the old Builder class does not
+ // initialize the field mClosures
if (mClosures != null) {
- // ScriptGroup created using the old Builder class does not
- // initialize the field mClosures
- mClosures.clear();
+ for (Closure c : mClosures) {
+ c.destroy();
+ }
}
- super.finalize();
}
}