When I exit out of an App, everything is released? Or if I have any pointer-arrays(malloc), do I have to release the pointers before exiting the App?
thanks
When I exit out of an App, everything is released? Or if I have any pointer-arrays(malloc), do I have to release the pointers before exiting the App?
thanks
This is not defined by the C specification (and thus not formally defined in Objective-C) but on iOS and all other modern operating systems, when a process terminates, its memory is returned to the system. So yes, any such pointers will be freed appropriately, though C++ destructors and Objective-C -dealloc
implementations will not be run.
As all other answers have noted, the answer is no. Interesting to note, however, is that in many cases you cannot deallocate memory, because the application has suddenly crashed. Barring any memory leaks in the OS itself, iOS will clean up the memory used by the application regardless of how it was allocated.