The code from SDWebImageDownloaderOperation connection:didFailWithError: should match the code from connectionDidFinishLoading:. This fixes #872

This commit is contained in:
Bogdan Poplauschi 2014-11-02 23:20:16 +02:00
parent 936f47c005
commit 7f39e5e60e
1 changed files with 8 additions and 5 deletions

View File

@ -337,8 +337,7 @@
responseFromCached = NO;
}
if (completionBlock)
{
if (completionBlock) {
if (self.options & SDWebImageDownloaderIgnoreCachedResponse && responseFromCached) {
completionBlock(nil, nil, nil, YES);
}
@ -364,13 +363,17 @@
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
@synchronized(self) {
CFRunLoopStop(CFRunLoopGetCurrent());
self.thread = nil;
self.connection = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:nil];
}
if (self.completedBlock) {
self.completedBlock(nil, nil, error, YES);
}
self.completionBlock = nil;
[self done];
}