File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1749,8 +1749,22 @@ - (void)main;
17491749 _runLoop = [NSRunLoop currentRunLoop ];
17501750 dispatch_group_leave (_waitGroup);
17511751
1752- NSTimer *timer = [[NSTimer alloc ] initWithFireDate: [NSDate distantFuture ] interval: 0.0 target: nil selector: nil userInfo: nil repeats: NO ];
1753- [_runLoop addTimer: timer forMode: NSDefaultRunLoopMode ];
1752+ // Add an empty run loop source to prevent runloop from spinning.
1753+ CFRunLoopSourceContext sourceCtx = {
1754+ .version = 0 ,
1755+ .info = NULL ,
1756+ .retain = NULL ,
1757+ .release = NULL ,
1758+ .copyDescription = NULL ,
1759+ .equal = NULL ,
1760+ .hash = NULL ,
1761+ .schedule = NULL ,
1762+ .cancel = NULL ,
1763+ .perform = NULL
1764+ };
1765+ CFRunLoopSourceRef source = CFRunLoopSourceCreate (NULL , 0 , &sourceCtx);
1766+ CFRunLoopAddSource (CFRunLoopGetCurrent (), source, kCFRunLoopDefaultMode );
1767+ CFRelease (source);
17541768
17551769 while ([_runLoop runMode: NSDefaultRunLoopMode beforeDate: [NSDate distantFuture ]]) {
17561770
You can’t perform that action at this time.
0 commit comments