Authored by DreamPiggy

A little enhancement to avoid block capture the heap object

@@ -60,7 +60,7 @@ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished); @@ -60,7 +60,7 @@ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished);
60 60
61 @end 61 @end
62 62
63 -// Convenience way to use transition. Remember to specify the duration 63 +// Convenience way to create transition. Remember to specify the duration
64 // for UIKit, these transition just use the correspond `animationOptions` 64 // for UIKit, these transition just use the correspond `animationOptions`
65 // for AppKit, these transition use Core Animation in `animations`. So your view must be layer-backed. Set `wantsLayer = YES` before you apply it. 65 // for AppKit, these transition use Core Animation in `animations`. So your view must be layer-backed. Set `wantsLayer = YES` before you apply it.
66 66
@@ -195,16 +195,16 @@ static char TAG_ACTIVITY_SHOW; @@ -195,16 +195,16 @@ static char TAG_ACTIVITY_SHOW;
195 #if SD_UIKIT || SD_MAC 195 #if SD_UIKIT || SD_MAC
196 else if ([view isKindOfClass:[UIImageView class]]) { 196 else if ([view isKindOfClass:[UIImageView class]]) {
197 UIImageView *imageView = (UIImageView *)view; 197 UIImageView *imageView = (UIImageView *)view;
198 - finalSetImageBlock = ^(UIImage *tempImage, NSData *tempData) {  
199 - imageView.image = image; 198 + finalSetImageBlock = ^(UIImage *setImage, NSData *setImageData) {
  199 + imageView.image = setImage;
200 }; 200 };
201 } 201 }
202 #endif 202 #endif
203 #if SD_UIKIT 203 #if SD_UIKIT
204 else if ([view isKindOfClass:[UIButton class]]) { 204 else if ([view isKindOfClass:[UIButton class]]) {
205 UIButton *button = (UIButton *)view; 205 UIButton *button = (UIButton *)view;
206 - finalSetImageBlock = ^(UIImage *tempImage, NSData *tempData){  
207 - [button setImage:image forState:UIControlStateNormal]; 206 + finalSetImageBlock = ^(UIImage *setImage, NSData *setImageData){
  207 + [button setImage:setImage forState:UIControlStateNormal];
208 }; 208 };
209 } 209 }
210 #endif 210 #endif