Merge pull request #1911 from disaabler/master
#1909: Crash on multiple concurrent downloads when accessing self.URLOperations dictionary
This commit is contained in:
commit
add6fc8fa3
|
@ -230,11 +230,13 @@
|
|||
|
||||
__weak SDWebImageDownloaderOperation *woperation = operation;
|
||||
operation.completionBlock = ^{
|
||||
SDWebImageDownloaderOperation *soperation = woperation;
|
||||
if (!soperation) return;
|
||||
if (self.URLOperations[url] == soperation) {
|
||||
[self.URLOperations removeObjectForKey:url];
|
||||
};
|
||||
dispatch_barrier_sync(self.barrierQueue, ^{
|
||||
SDWebImageDownloaderOperation *soperation = woperation;
|
||||
if (!soperation) return;
|
||||
if (self.URLOperations[url] == soperation) {
|
||||
[self.URLOperations removeObjectForKey:url];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
id downloadOperationCancelToken = [operation addHandlersForProgress:progressBlock completed:completedBlock];
|
||||
|
|
Loading…
Reference in New Issue