Merge pull request #1340 from lagapollo/lagapollo-patch-1
Memory usage upgrade
This commit is contained in:
commit
53ef2dc3c3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue