smartcrop icon indicating copy to clipboard operation
smartcrop copied to clipboard

Memory issues

Open poojab opened this issue 6 years ago • 1 comments

Works very nice but getting crash if I try to add and modify multiple image continuously using this. screenshot is only for one image filtering. How to resolve this? screen shot 2018-10-30 at 4 53 59 pm

poojab avatar Oct 30 '18 11:10 poojab

This issue is happening because of non-release of memory once consumed. The solution to this is to release the allocated memory once the work is done. I have found a fix to this memory issue by adding the following statements in UIImage+fixOrientation.m file in function fixOrientation.

UIImage* orientedImage = [UIImage imageWithCGImage:cgImage];

// Release from memory
CGImageRelease(cgImage);
CGContextRelease(ctx);
return orientedImage;
Screenshot 2021-07-07 at 10 59 42 PM

Using this solution, you can capture as many as images you want without affecting the memory.

adk-kapur avatar Jul 07 '21 17:07 adk-kapur