Merge pull request #278 from Reflejo/invalidcost

Invalid cost calculation when saving image to memory cache
This commit is contained in:
Olivier Poitrey 2013-01-17 13:48:48 -08:00
commit 788ff6759f
1 changed files with 2 additions and 1 deletions

View File

@ -179,7 +179,8 @@ static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
if (diskImage)
{
[self.memCache setObject:diskImage forKey:key cost:image.size.height * image.size.width * image.scale];
CGFloat cost = diskImage.size.height * diskImage.size.width * diskImage.scale;
[self.memCache setObject:diskImage forKey:key cost:cost];
}
dispatch_async(dispatch_get_main_queue(), ^