MWPhotoBrowser icon indicating copy to clipboard operation
MWPhotoBrowser copied to clipboard

memory leak

Open hw20101101 opened this issue 5 years ago • 0 comments

WX20200704-111511@2x

#import "UIImage+MWPhotoBrowser.h"

@implementation UIImage (MWPhotoBrowser)

+ (UIImage *)imageForResourcePath:(NSString *)path ofType:(NSString *)type inBundle:(NSBundle *)bundle {
    return [UIImage imageWithContentsOfFile:[bundle pathForResource:path ofType:type]];
}

+ (UIImage *)clearImageWithSize:(CGSize)size {
    UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
    UIImage *blank = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return blank;
}

@end


memory leak: [UIImage imageWithContentsOfFile:[bundle pathForResource:path ofType:type]];

hw20101101 avatar Jul 04 '20 03:07 hw20101101