From 50f9ddd5a810492c1c20bc480cc93bbb6c6ed779 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Thu, 21 Feb 2019 22:28:23 +0800 Subject: [PATCH] Nil imageData before decode process to free memory --- SDWebImage/SDWebImageDownloaderOperation.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index 445dbc44..c10ba8d4 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -201,7 +201,6 @@ typedef NSMutableDictionary SDCallbacksDictionary; } else { [self callCompletionBlocksWithError:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorUnknown userInfo:@{NSLocalizedDescriptionKey : @"Task can't be initialized"}]]; [self done]; - return; } } @@ -403,6 +402,7 @@ didReceiveResponse:(NSURLResponse *)response * If you specified to use `NSURLCache`, then the response you get here is what you need. */ __block NSData *imageData = [self.imageData copy]; + self.imageData = nil; if (imageData) { /** if you specified to only use cached data via `SDWebImageDownloaderIgnoreCachedResponse`, * then we should check if the cached data is equal to image data