Merge pull request #1340 from lagapollo/lagapollo-patch-1

Memory usage upgrade
This commit is contained in:
Bogdan Poplauschi 2015-10-25 19:19:45 +02:00
commit 53ef2dc3c3
1 changed files with 48 additions and 40 deletions

View File

@ -13,6 +13,13 @@
@implementation UIImage (ForceDecode)
+ (UIImage *)decodedImageWithImage:(UIImage *)image {
// while downloading huge amount of images
// autorelease the bitmap context
// and all vars to help system to free memory
// when there are memory warning.
// on iOS7, do not forget to call
// [[SDImageCache sharedImageCache] clearMemory];
@autoreleasepool{
// do not decode animated images
if (image.images) { return image; }
@ -56,6 +63,7 @@
CGImageRelease(imageRefWithAlpha);
return imageWithAlpha;
}
}
@end