Skip to content

Commit ab919d8

Browse files
committed
Merge pull request facebookincubator#247 from james-howard/FixNonNullable
Fix iOS 9 / El Cap build error due to non-nullability changes
2 parents bfc2dba + 9af1b11 commit ab919d8

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

SocketRocket/SRWebSocket.m

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)