summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/Script.java
diff options
context:
space:
mode:
Diffstat (limited to 'rs/java/android/renderscript/Script.java')
-rw-r--r--rs/java/android/renderscript/Script.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java
index f6f93cb7b964..fc3280be3ac7 100644
--- a/rs/java/android/renderscript/Script.java
+++ b/rs/java/android/renderscript/Script.java
@@ -41,6 +41,7 @@ public class Script extends BaseObj {
mScript = s;
mSlot = slot;
mSig = sig;
+ guard.open("destroy");
}
}
@@ -118,6 +119,7 @@ public class Script extends BaseObj {
super(id, rs);
mScript = s;
mSlot = slot;
+ guard.open("destroy");
}
}
@@ -357,6 +359,19 @@ public class Script extends BaseObj {
super(id, rs);
mInIdsBuffer = new long[1];
+
+ /* The constructors for the derived classes (including ScriptIntrinsic
+ * derived classes and ScriptC derived classes generated by Slang
+ * reflection) seem to be simple enough, so we just put the guard.open()
+ * call here, rather than in the end of the constructor for the derived
+ * class. This, of course, assumes the derived constructor would not
+ * throw any exception after calling this constructor.
+ *
+ * If new derived classes are added with more complicated constructors
+ * that throw exceptions, this call has to be (duplicated and) moved
+ * to the end of each derived class constructor.
+ */
+ guard.open("destroy");
}
/**