iOS drawInRect memory spike can’t be reclaimed memory leak

The drawInRect method is used from time to time in UIImage processing, but the downside is that it takes up too much memory and causes memory leaks that can’t be reclaimed. This is because the object is held, resulting in the reason that it can not be released in time. Call this method a few more times and the memory skyrockets.
So, the way I currently use is to cache the UIImage object locally as a picture, and then release the object normally UIGraphicsEndImageContext(); then pass out the path to the cached UIImage to read.
This way the memory release issue is handled, and multiple calls to this method will not result in memory not being reclaimed.
Despite the network to find the answer to the question, autoRelease release pool can not be handled.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *