...
|
...
|
@@ -404,12 +404,14 @@ didReceiveResponse:(NSURLResponse *)response |
|
|
} else {
|
|
|
SDWebImageDownloaderCompletedBlock completionBlock = self.completedBlock;
|
|
|
|
|
|
if (![[NSURLCache sharedURLCache] cachedResponseForRequest:self.request]) {
|
|
|
responseFromCached = NO;
|
|
|
}
|
|
|
|
|
|
if (completionBlock) {
|
|
|
if (self.options & SDWebImageDownloaderIgnoreCachedResponse && responseFromCached) {
|
|
|
/**
|
|
|
* See #1608 and #1623 - apparently, there is a race condition on `NSURLCache` that causes a crash
|
|
|
* Limited the calls to `cachedResponseForRequest:` only for cases where we should ignore the cached response
|
|
|
* and images for which responseFromCached is YES (only the ones that cannot be cached).
|
|
|
* Note: responseFromCached is set to NO inside `willCacheResponse:`. This method doesn't get called for large images or images behind authentication
|
|
|
*/
|
|
|
if (self.options & SDWebImageDownloaderIgnoreCachedResponse && responseFromCached && [[NSURLCache sharedURLCache] cachedResponseForRequest:self.request]) {
|
|
|
completionBlock(nil, nil, nil, YES);
|
|
|
} else if (self.imageData) {
|
|
|
UIImage *image = [UIImage sd_imageWithData:self.imageData];
|
...
|
...
|
|