From a863da18ecddc7947783a2162afbce38245229ce Mon Sep 17 00:00:00 2001 From: Blake Watters Date: Thu, 20 Oct 2011 11:55:00 -0400 Subject: [PATCH] Revert "Use run loop instead of dispatch queue as unscheduling via NULL queue is triggering errors. refs #408" This reverts commit fa6cff822196a2ac45ead075f52c9fc78ec57ac9. --- Code/Network/RKReachabilityObserver.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Network/RKReachabilityObserver.m b/Code/Network/RKReachabilityObserver.m index 8dcdfe8b..25f38c72 100755 --- a/Code/Network/RKReachabilityObserver.m +++ b/Code/Network/RKReachabilityObserver.m @@ -337,8 +337,8 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach return; } - if (! SCNetworkReachabilityScheduleWithRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) { - RKLogWarning("%@: SCNetworkReachabilityScheduleWithRunLoop() failed: %s", self, SCErrorString(SCError())); + if (! SCNetworkReachabilitySetDispatchQueue(_reachabilityRef, dispatch_get_main_queue())) { + RKLogWarning("%@: SCNetworkReachabilitySetDispatchQueue() 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 (! SCNetworkReachabilityUnscheduleFromRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) { - RKLogWarning("%@: SCNetworkReachabilityUnscheduleFromRunLoop() failed: %s\n", self, SCErrorString(SCError())); + if (! SCNetworkReachabilitySetDispatchQueue(_reachabilityRef, NULL)) { + RKLogWarning("%@: SCNetworkReachabilitySetDispatchQueue() failed: %s\n", self, SCErrorString(SCError())); return; } } else {