iOS:fix timer invalid
This commit is contained in:
parent
de9b96c490
commit
2c2d3e4113
@ -224,11 +224,13 @@ - (void)destroyContext:(NSString *)contextId {
|
||||
|
||||
- (void)callbackTimer:(NSTimer *)timer {
|
||||
__weak typeof(self) _self = self;
|
||||
if (!timer.isValid) {
|
||||
return;
|
||||
}
|
||||
NSDictionary *userInfo = timer.userInfo;
|
||||
NSNumber *timerId = [userInfo valueForKey:@"timerId"];
|
||||
NSNumber *repeat = [userInfo valueForKey:@"repeat"];
|
||||
dispatch_async(self.jsQueue, ^() {
|
||||
NSDictionary *userInfo = timer.userInfo;
|
||||
NSNumber *timerId = [userInfo valueForKey:@"timerId"];
|
||||
NSNumber *repeat = [userInfo valueForKey:@"repeat"];
|
||||
|
||||
__strong typeof(_self) self = _self;
|
||||
@try {
|
||||
[self invokeDoricMethod:DORIC_TIMER_CALLBACK, timerId, nil];
|
||||
|
Reference in New Issue
Block a user