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