Closed ertan95 closed 5 months ago
Fixed it by modifying CustomCropManager.mm
. I added this line of codeCGImageRelease(cgimage); // important to avoid memory leaks
Here's the code snippet from CustomCropManager.mm
:
CIContext *context = [CIContext contextWithOptions:nil];
CGImageRef cgimage = [context createCGImage:ciImage fromRect:[ciImage extent]];
UIImage *image = [UIImage imageWithCGImage:cgimage];
CGImageRelease(cgimage); // important to avoid memory leaks
Every time I take a Photo with
react-native-document-scanner
and then crop the Image the memory usage of my react native app keeps increasing by 20-30mb. I don't now why it's not releasing the RAM after the crop. Any ideas?