Use run loop instead of dispatch queue as unscheduling via NULL queue is triggering errors. refs #408

This commit is contained in:
Blake Watters
2011-10-20 11:40:56 -04:00
parent d75fd7d0b0
commit fa6cff8221

View File

@@ -337,8 +337,8 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
return;
}
if (! SCNetworkReachabilitySetDispatchQueue(_reachabilityRef, dispatch_get_main_queue())) {
RKLogWarning("%@: SCNetworkReachabilitySetDispatchQueue() failed: %s", self, SCErrorString(SCError()));
if (! SCNetworkReachabilityScheduleWithRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) {
RKLogWarning("%@: SCNetworkReachabilityScheduleWithRunLoop() failed: %s", self, SCErrorString(SCError()));
return;
}
}
@@ -346,8 +346,8 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
- (void)unscheduleObserver {
if (_reachabilityRef) {
RKLogDebug(@"%@: Unscheduling reachability observer from main dispatch queue", self);
if (! SCNetworkReachabilitySetDispatchQueue(_reachabilityRef, NULL)) {
RKLogWarning("%@: SCNetworkReachabilitySetDispatchQueue() failed: %s\n", self, SCErrorString(SCError()));
if (! SCNetworkReachabilityUnscheduleFromRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) {
RKLogWarning("%@: SCNetworkReachabilityUnscheduleFromRunLoop() failed: %s\n", self, SCErrorString(SCError()));
return;
}
} else {