Validate objects are from the correct context.
Change-Id: I7d87b0e253b8d2e36d1aed790cfe3a7dd23e158f
This commit is contained in:
@ -1004,6 +1004,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