commit | 678cc7fe9fef00fb3381e64f95cc6907796bcd8e | [log] [tgz] |
---|---|---|
author | Jason Sams <jsams@google.com> | Wed Mar 05 16:09:02 2014 -0800 |
committer | Jason Sams <jsams@google.com> | Wed Mar 05 16:09:02 2014 -0800 |
tree | ffaba9543cfbc5de64b73b6b895a63ffef87bd87 | |
parent | 22f66b76f5e49704f3be76ad3fff7e4b5456864d [diff] [blame] |
Validate objects are from the correct context. Change-Id: I7d87b0e253b8d2e36d1aed790cfe3a7dd23e158f
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index 7db331f..eebeaa4 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java
@@ -1004,6 +1004,14 @@ } } + void validateObject(BaseObj o) { + if (o != null) { + if (o.mRS != this) { + throw new RSIllegalArgumentException("Attempting to use an object across contexts."); + } + } + } + void validate() { if (mContext == 0) { throw new RSInvalidStateException("Calling RS with no Context active.");