am edf0b79d: am 24ea88a9: am 9a9916b5: am 2383f220: Merge "Validate objects are from the correct context."

* commit 'edf0b79d55df17fddb6b96de32f34ffccc8ec2d4':
  Validate objects are from the correct context.
This commit is contained in:
Jason Sams
2014-03-06 02:29:06 +00:00
committed by Android Git Automerger
2 changed files with 17 additions and 0 deletions

View File

@ -1000,6 +1000,14 @@ public class RenderScript {
}
}
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.");