feat:fix params dealloced before invoke

This commit is contained in:
pengfei.zhou 2019-12-05 15:29:29 +08:00
parent e63574ccca
commit 7218ec3d1b

View File

@ -73,11 +73,15 @@ - (id)findClass:(Class)clz target:(id)target context:(DoricContext *)context met
dispatch_block_t block = ^() { dispatch_block_t block = ^() {
__strong __typeof__(_self) self = _self; __strong __typeof__(_self) self = _self;
@try { @try {
NSMutableArray *tempArray = [NSMutableArray new];
for (NSUInteger idx = 2; idx < methodSignature.numberOfArguments; idx++) { for (NSUInteger idx = 2; idx < methodSignature.numberOfArguments; idx++) {
if (idx - 2 > [array count]) { if (idx - 2 > [array count]) {
break; break;
} }
id args = [self createParamWithMethodName:array[idx - 2] context:context callbackId:callbackId argument:argument]; id args = [self createParamWithMethodName:array[idx - 2] context:context callbackId:callbackId argument:argument];
if (args) {
[tempArray addObject:args];
}
[invocation setArgument:&args atIndex:idx]; [invocation setArgument:&args atIndex:idx];
} }
[invocation invoke]; [invocation invoke];