ios cropping images multiple times in a row may cause a crash
Allen0505 opened this issue · 1 comments
Allen0505 commented
ios cropping images multiple times in a row may cause a crash
There is a memory leak in ios cropping and rotating pictures
add "CGImageRelease(resultCg)" to release memory in FIUIImageHandler.m
- (void)clip:(FIClipOption *)option {
CGImageRef cg = outImage.CGImage;
CGRect rect = CGRectMake(option.x, option.y, option.width, option.height);
CGImageRef resultCg = CGImageCreateWithImageInRect(cg, rect);
outImage = [UIImage imageWithCGImage:resultCg];
CGImageRelease(resultCg); // release memory
}
FIEPlugin.m
- (void)asyncExec:(VoidBlock)block {
dispatch_async(_queue, ^(){
@autoreleasepool {
block();
}
});
}