CGImageRef Memory leak

前端 未结 4 1045
一个人的身影
一个人的身影 2020-12-10 06:35

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 ?

4条回答
  •  难免孤独
    2020-12-10 07:22

    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.

提交回复
热议问题