Merge pull request #2548 from SDWebImage/revert-2531-fix_reuse_wrong_image

Revert "Add image url check when set image"
This commit is contained in:
DreamPiggy 2018-12-05 18:25:15 +08:00 committed by GitHub
commit 32d096a478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -101,7 +101,7 @@ static char TAG_ACTIVITY_SHOW;
};
id <SDWebImageOperation> operation = [manager loadImageWithURL:url options:options progress:combinedProgressBlock completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
__strong __typeof (wself) sself = wself;
if (!sself || ![imageURL isEqual:sself.sd_imageURL]) { return; }
if (!sself) { return; }
#if SD_UIKIT
[sself sd_removeActivityIndicator];
#endif
@ -114,10 +114,9 @@ static char TAG_ACTIVITY_SHOW;
BOOL shouldNotSetImage = ((image && (options & SDWebImageAvoidAutoSetImage)) ||
(!image && !(options & SDWebImageDelayPlaceholder)));
SDWebImageNoParamsBlock callCompletedBlockClojure = ^{
__strong __typeof(wself) strongSelf = wself;
if (!strongSelf || ![strongSelf.sd_imageURL isEqual:imageURL]) { return; }
if (!sself) { return; }
if (!shouldNotSetImage) {
[strongSelf sd_setNeedsLayout];
[sself sd_setNeedsLayout];
}
if (completedBlock && shouldCallCompletedBlock) {
completedBlock(image, error, cacheType, url);
@ -155,7 +154,6 @@ static char TAG_ACTIVITY_SHOW;
if (group) {
dispatch_group_enter(group);
}
if (![sself.sd_imageURL isEqual:imageURL]) { return ; }
#if SD_UIKIT || SD_MAC
[sself sd_setImage:targetImage imageData:targetData basedOnClassOrViaCustomSetImageBlock:setImageBlock transition:transition cacheType:cacheType imageURL:imageURL];
#else