Permalink
Browse files

Merge pull request #275 from erikchen/master

Clean up the use of CFRunLoop.
  • Loading branch information...
2 parents 4f95498 + 80e1dc8 commit d9869527dc1eedc90306d4429166948151402d1f @erikchen erikchen committed Jan 22, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 Classes/ASIHTTPRequest.m
@@ -3515,7 +3515,7 @@ - (void)handleStreamComplete
// If request has asked delegate or ASIAuthenticationDialog for credentials
} else if ([self authenticationNeeded]) {
- CFRunLoopStop(CFRunLoopGetCurrent());
+ // Do nothing.
}
}
@@ -3555,8 +3555,6 @@ - (void)markAsFinished
if (!wasFinished)
[self didChangeValueForKey:@"isFinished"];
- CFRunLoopStop(CFRunLoopGetCurrent());
-
#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0
if ([ASIHTTPRequest isMultitaskingSupported] && [self shouldContinueWhenAppEntersBackground]) {
dispatch_async(dispatch_get_main_queue(), ^{
@@ -4795,7 +4793,7 @@ + (void)runRequests
BOOL runAlways = YES; // Introduced to cheat Static Analyzer
while (runAlways) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- CFRunLoopRun();
+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1.0e10, true);
[pool drain];
}

0 comments on commit d986952

Please sign in to comment.