When the application exits, everything in memory is destroyed by the system (it is not freed, but simply destroyed when the address space is returned to the system).
While others suggested using the Leaks tool to find leaks in your application, Leaks will not find many different types of memory. If the object is selected, somewhere it is pushed into the cache somewhere, then the key to this object in the cache is lost, the object leaks efficiently (it cannot be used again), but will not be found by leaks, because it is still connected to your viable graphic object .
The best bet is to use Heapshot analysis to see how the graph of your application is growing. I wrote a tutorial using Heapshot analysis that may be useful to you.
If you want to capture a snapshot before your application exits, put sleep(1000); in your code either in the application completion handler, or in another place that runs immediately before the application exits.
Remember to remove it before submitting the assembly. :)
source share