Merge pull request #1849 from GibaPadavan/fix_autorelease_pool
[bugfix] Added @autoreleasepool to SDImageCache.storeImage
This commit is contained in:
commit
9231d6d500
|
@ -217,14 +217,15 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
|
|||
|
||||
if (toDisk) {
|
||||
dispatch_async(self.ioQueue, ^{
|
||||
NSData *data = imageData;
|
||||
|
||||
if (!data && image) {
|
||||
SDImageFormat imageFormatFromData = [NSData sd_imageFormatForImageData:data];
|
||||
data = [image sd_imageDataAsFormat:imageFormatFromData];
|
||||
@autoreleasepool {
|
||||
NSData *data = imageData;
|
||||
if (!data && image) {
|
||||
SDImageFormat imageFormatFromData = [NSData sd_imageFormatForImageData:data];
|
||||
data = [image sd_imageDataAsFormat:imageFormatFromData];
|
||||
}
|
||||
[self storeImageDataToDisk:data forKey:key];
|
||||
}
|
||||
|
||||
[self storeImageDataToDisk:data forKey:key];
|
||||
if (completionBlock) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
completionBlock();
|
||||
|
|
Loading…
Reference in New Issue