diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index fe63cc43..e4422d5d 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -125,9 +125,8 @@ url = nil; } - __block SDWebImageCombinedOperation *operation = [SDWebImageCombinedOperation new]; + SDWebImageCombinedOperation *operation = [SDWebImageCombinedOperation new]; operation.manager = self; - __weak SDWebImageCombinedOperation *weakOperation = operation; BOOL isFailedUrl = NO; if (url) { @@ -150,7 +149,8 @@ if (options & SDWebImageCacheMemoryOnly) cacheOptions |= SDImageCacheQueryMemoryOnly; if (options & SDWebImageQueryDataWhenInMemory) cacheOptions |= SDImageCacheQueryDataWhenInMemory; if (options & SDWebImageQueryDiskSync) cacheOptions |= SDImageCacheQueryDiskSync; - + + __weak SDWebImageCombinedOperation *weakOperation = operation; operation.cacheOperation = [self.imageCache queryCacheOperationForKey:key options:cacheOptions done:^(UIImage *cachedImage, NSData *cachedData, SDImageCacheType cacheType) { __strong __typeof(weakOperation) strongOperation = weakOperation; if (!strongOperation || strongOperation.isCancelled) {