Merge pull request #388 from cfis/synchronize_failed_urls

Synchronize self.failedURLs
This commit is contained in:
Olivier Poitrey 2013-05-08 05:37:18 -07:00
commit 899d67ba54
1 changed files with 7 additions and 1 deletions

View File

@ -83,7 +83,13 @@
__block SDWebImageCombinedOperation *operation = SDWebImageCombinedOperation.new;
__weak SDWebImageCombinedOperation *weakOperation = operation;
if (!url || !completedBlock || (!(options & SDWebImageRetryFailed) && [self.failedURLs containsObject:url]))
BOOL isFailedUrl = NO;
@synchronized(self.failedURLs)
{
isFailedUrl = [self.failedURLs containsObject:url];
}
if (!url || !completedBlock || (!(options & SDWebImageRetryFailed) && isFailedUrl))
{
if (completedBlock) completedBlock(nil, nil, SDImageCacheTypeNone, NO);
return operation;