Skip to content

Commit a3ea3be

Browse files
authored
Merge pull request #88 from paricleu/master
fix: memory leak rotating cropping, closes #85
2 parents 502775e + 019c0c6 commit a3ea3be

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ios/Classes/FIEPlugin.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ - (void)initQueue {
6666
}
6767

6868
- (void)asyncExec:(VoidBlock)block {
69-
dispatch_async(_queue, block);
69+
dispatch_async(_queue, ^(){
70+
@autoreleasepool {
71+
block();
72+
}
73+
});
7074
}
7175

7276
- (void)handleMerge:(id)args

ios/Classes/FIUIImageHandler.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ - (void)clip:(FIClipOption *)option {
143143
CGRect rect = CGRectMake(option.x, option.y, option.width, option.height);
144144
CGImageRef resultCg = CGImageCreateWithImageInRect(cg, rect);
145145
outImage = [UIImage imageWithCGImage:resultCg];
146+
CGImageRelease(resultCg);
146147
}
147148

148149
#pragma mark rotate

0 commit comments

Comments
 (0)