Skip to content

Commit

Permalink
Fix lock error, apparently @finally blocks execute after a return
Browse files Browse the repository at this point in the history
  • Loading branch information
pokeb committed Jun 24, 2010
1 parent 2428b3b commit 67ab4fe
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Classes/ASIHTTPRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

// Automatically set on build

NSString *ASIHTTPRequestVersion = @"v1.6.2-66 2010-06-24";
NSString *ASIHTTPRequestVersion = @"v1.6.2-67 2010-06-24";

NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain";

Expand Down Expand Up @@ -597,15 +597,13 @@ - (void)main
if ([self error]) {
[self setComplete:YES];
[self markAsFinished];
[[self cancelledLock] unlock];
return;
}

[self setComplete:NO];

if (![self url]) {
[self failWithError:ASIUnableToCreateRequestError];
[[self cancelledLock] unlock];
return;
}

Expand All @@ -628,7 +626,6 @@ - (void)main
request = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)[self requestMethod], (CFURLRef)[self url], [self useHTTPVersionOne] ? kCFHTTPVersion1_0 : kCFHTTPVersion1_1);
if (!request) {
[self failWithError:ASIUnableToCreateRequestError];
[[self cancelledLock] unlock];
return;
}

Expand All @@ -648,7 +645,6 @@ - (void)main
// See if we should pull from the cache rather than fetching the data
if ([self cachePolicy] == ASIOnlyLoadIfNotCachedCachePolicy) {
if ([self useDataFromCache]) {
[[self cancelledLock] unlock];
return;
}
} else if ([self cachePolicy] == ASIReloadIfDifferentCachePolicy) {
Expand Down Expand Up @@ -1501,7 +1497,6 @@ + (void)updateProgressIndicator:(id)indicator withProgress:(unsigned long long)p
}

[progressLock lock];

[ASIHTTPRequest performSelector:selector onTarget:indicator withObject:nil amount:&progressAmount];
[progressLock unlock];
}
Expand Down

0 comments on commit 67ab4fe

Please sign in to comment.