Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the use of CFRunLoop. #275

Merged
merged 1 commit into from Jan 22, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions Classes/ASIHTTPRequest.m
Expand Up @@ -3507,7 +3507,7 @@ - (void)handleStreamComplete

// If request has asked delegate or ASIAuthenticationDialog for credentials
} else if ([self authenticationNeeded]) {
CFRunLoopStop(CFRunLoopGetCurrent());
// Do nothing.
}

}
Expand Down Expand Up @@ -3547,8 +3547,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(), ^{
Expand Down Expand Up @@ -4787,7 +4785,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];
}

Expand Down