iOS: Ensure that rendering operations are serialized to prevent timing errors
This commit is contained in:
@@ -109,7 +109,14 @@ - (id)findClass:(Class)clz target:(id)target context:(DoricContext *)context met
|
||||
const char *retType = methodSignature.methodReturnType;
|
||||
if (!strcmp(retType, @encode(void))) {
|
||||
ret = nil;
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
|
||||
DoricThreadMode mode = [target threadMode:methodName];
|
||||
if (mode == DoricThreadModeUI) {
|
||||
dispatch_async(dispatch_get_main_queue(), block);
|
||||
} else if (mode == DoricThreadModeJS) {
|
||||
block();
|
||||
} else {
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
|
||||
}
|
||||
} else if (!strcmp(retType, @encode(id))) {
|
||||
void *retValue;
|
||||
block();
|
||||
|
Reference in New Issue
Block a user