This should make no difference at all, but it seems mildly more correct (#3414)

This commit is contained in:
Chris Jones 2023-03-08 09:30:30 +00:00 committed by GitHub
parent f2107bd8f8
commit 08abbc29d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -38,6 +38,7 @@ static LSRefTable refTable;
LuaSkin *skin = [LuaSkin sharedWithState:NULL];
if (![skin checkGCCanary:self.lsCanary]) {
[self stop];
return;
}
@ -70,7 +71,7 @@ static LSRefTable refTable;
}
- (BOOL)isRunning {
return CFRunLoopContainsTimer(CFRunLoopGetCurrent(), (__bridge CFRunLoopTimerRef)self.t, kCFRunLoopDefaultMode);
return CFRunLoopContainsTimer(CFRunLoopGetMain(), (__bridge CFRunLoopTimerRef)self.t, kCFRunLoopDefaultMode);
}
- (void)start {
@ -80,7 +81,7 @@ static LSRefTable refTable;
}
[self setNextTrigger:self.interval];
[[NSRunLoop currentRunLoop] addTimer:self.t forMode:NSRunLoopCommonModes];
[[NSRunLoop mainRunLoop] addTimer:self.t forMode:NSRunLoopCommonModes];
}
- (void)stop {