Possible Troubles For Apple? - We ALWAYS Need To Remember Memory
Posted by Mike Brunt at 3:32 PM
23 comments - Categories: Web Servers | Languages | RIA
I rarely simply point to an article, nor simply reproduce a part of it but in this blog piece I am doing both. This is a very important read for all those developing in Objective-C and those who have myopically embraced all that Apple does as their world. This is the full article.
"This allows a single object to be used by several different parts of the application, each of which is responsible for bookending its use of the object with
release messages. If
retain is sent to an object more times than
release, then its reference count will never reach zero and its memory will never be freed. This is called a memory leak. If
release is sent more times than
retain, then a
release message sent after the object's reference count has reached zero will find itself looking at the region of memory formerlyoccupied by the object, which may now contain anything at all. A crash usually ensues."