Explorar o código

Fixed image memory calculation

周明宇 %!s(int64=9) %!d(string=hai) anos
pai
achega
fac9d87340
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      UIKit+AFNetworking/AFAutoPurgingImageCache.m

+ 2 - 2
UIKit+AFNetworking/AFAutoPurgingImageCache.m

@@ -44,8 +44,8 @@
 
         CGSize imageSize = CGSizeMake(image.size.width * image.scale, image.size.height * image.scale);
         CGFloat bytesPerPixel = 4.0;
-        CGFloat bytesPerRow = imageSize.width * bytesPerPixel;
-        self.totalBytes = (UInt64)bytesPerPixel * (UInt64)bytesPerRow;
+        CGFloat bytesPerSize = imageSize.width * imageSize.height;
+        self.totalBytes = (UInt64)bytesPerPixel * (UInt64)bytesPerSize;
         self.lastAccessDate = [NSDate date];
     }
     return self;