I\'m having a memory leak when using this custom method which returns a CGImageRef. I can\'t release \"cgImage\" properly because I have to return it. What chould I do ?
As suggested, we used:
CGImageRelease(imageRef);
but we still got an memory leak. our solution was to wrap code with an
@autoreleasepool {}
block and that solve our problem.