Skip to content

Commit

Permalink
Merge pull request #388 from cfis/synchronize_failed_urls
Browse files Browse the repository at this point in the history
Synchronize self.failedURLs
  • Loading branch information
Olivier Poitrey committed May 8, 2013
2 parents 990df9f + 0426f07 commit 899d67b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SDWebImage/SDWebImageManager.m
Expand Up @@ -83,7 +83,13 @@ - (NSString *)cacheKeyForURL:(NSURL *)url
__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;
Expand Down

0 comments on commit 899d67b

Please sign in to comment.