Fix lock error, apparently @finally blocks execute after a return
Showing
1 changed file
with
1 additions
and
6 deletions
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | 24 | ||
| 25 | // Automatically set on build | 25 | // Automatically set on build |
| 26 | 26 | ||
| 27 | -NSString *ASIHTTPRequestVersion = @"v1.6.2-66 2010-06-24"; | 27 | +NSString *ASIHTTPRequestVersion = @"v1.6.2-67 2010-06-24"; |
| 28 | 28 | ||
| 29 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; | 29 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; |
| 30 | 30 | ||
| @@ -597,7 +597,6 @@ static NSOperationQueue *sharedQueue = nil; | @@ -597,7 +597,6 @@ static NSOperationQueue *sharedQueue = nil; | ||
| 597 | if ([self error]) { | 597 | if ([self error]) { |
| 598 | [self setComplete:YES]; | 598 | [self setComplete:YES]; |
| 599 | [self markAsFinished]; | 599 | [self markAsFinished]; |
| 600 | - [[self cancelledLock] unlock]; | ||
| 601 | return; | 600 | return; |
| 602 | } | 601 | } |
| 603 | 602 | ||
| @@ -605,7 +604,6 @@ static NSOperationQueue *sharedQueue = nil; | @@ -605,7 +604,6 @@ static NSOperationQueue *sharedQueue = nil; | ||
| 605 | 604 | ||
| 606 | if (![self url]) { | 605 | if (![self url]) { |
| 607 | [self failWithError:ASIUnableToCreateRequestError]; | 606 | [self failWithError:ASIUnableToCreateRequestError]; |
| 608 | - [[self cancelledLock] unlock]; | ||
| 609 | return; | 607 | return; |
| 610 | } | 608 | } |
| 611 | 609 | ||
| @@ -628,7 +626,6 @@ static NSOperationQueue *sharedQueue = nil; | @@ -628,7 +626,6 @@ static NSOperationQueue *sharedQueue = nil; | ||
| 628 | request = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)[self requestMethod], (CFURLRef)[self url], [self useHTTPVersionOne] ? kCFHTTPVersion1_0 : kCFHTTPVersion1_1); | 626 | request = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)[self requestMethod], (CFURLRef)[self url], [self useHTTPVersionOne] ? kCFHTTPVersion1_0 : kCFHTTPVersion1_1); |
| 629 | if (!request) { | 627 | if (!request) { |
| 630 | [self failWithError:ASIUnableToCreateRequestError]; | 628 | [self failWithError:ASIUnableToCreateRequestError]; |
| 631 | - [[self cancelledLock] unlock]; | ||
| 632 | return; | 629 | return; |
| 633 | } | 630 | } |
| 634 | 631 | ||
| @@ -648,7 +645,6 @@ static NSOperationQueue *sharedQueue = nil; | @@ -648,7 +645,6 @@ static NSOperationQueue *sharedQueue = nil; | ||
| 648 | // See if we should pull from the cache rather than fetching the data | 645 | // See if we should pull from the cache rather than fetching the data |
| 649 | if ([self cachePolicy] == ASIOnlyLoadIfNotCachedCachePolicy) { | 646 | if ([self cachePolicy] == ASIOnlyLoadIfNotCachedCachePolicy) { |
| 650 | if ([self useDataFromCache]) { | 647 | if ([self useDataFromCache]) { |
| 651 | - [[self cancelledLock] unlock]; | ||
| 652 | return; | 648 | return; |
| 653 | } | 649 | } |
| 654 | } else if ([self cachePolicy] == ASIReloadIfDifferentCachePolicy) { | 650 | } else if ([self cachePolicy] == ASIReloadIfDifferentCachePolicy) { |
| @@ -1501,7 +1497,6 @@ static NSOperationQueue *sharedQueue = nil; | @@ -1501,7 +1497,6 @@ static NSOperationQueue *sharedQueue = nil; | ||
| 1501 | } | 1497 | } |
| 1502 | 1498 | ||
| 1503 | [progressLock lock]; | 1499 | [progressLock lock]; |
| 1504 | - | ||
| 1505 | [ASIHTTPRequest performSelector:selector onTarget:indicator withObject:nil amount:&progressAmount]; | 1500 | [ASIHTTPRequest performSelector:selector onTarget:indicator withObject:nil amount:&progressAmount]; |
| 1506 | [progressLock unlock]; | 1501 | [progressLock unlock]; |
| 1507 | } | 1502 | } |
-
Please register or login to post a comment