ios-when using Vpimagecropper analyze appears potential leak of an object stored into ' subimageref '

Source: Internet
Author: User

Analyze today, this problem occurs, is a third-party cutting the picture of the class called Vpimagecropper, the results found that he has problems, Look at the picture and everyone will understand. Subimageref Memory Count + 1 when calling Cgimagecreatewithimageinrect, but did not release after the run-up.

Then the problem comes, this vpimagecropper is to support arc, that is, the system encountered this side is not good use, can not be released. So there's a memory leak.

Later on StackOverflow find such a passage

ARC does not manage C-types, the which cgimage may be considered. You must release the ref manually if you were finished withCGImageRelease(image);

that is, not everything in arc mode can be freed. Objects such as c-types need to be released manually

That's all I'm saying. cgimagerelease (subimageref)

Then we look at the problem solved ~



ios-when using Vpimagecropper analyze appears potential leak of an object stored into ' subimageref '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.