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:
@ -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.");
|
||||
|
Reference in New Issue
Block a user