Please sign in to comment.
Clean up the use of CFRunLoop.
Previously, tasks running from inside the CFRunLoop would call CFRunLoopStop prior to finishing execution. This results in non-deterministic failures to call endBackgroundTask when running iOS tasks in the background with beginBackgroundTaskWithExpirationHandler. Since the only reason to break out of the CFRunLoop is to flush the autorelease pool, we instead invoke CFRunLoopRunInMode with returnAfterSourceHandled=True, which safely returns and flushes the autorelease pool after each invocation of the CFRunLoop.
- Loading branch information...