On 09/11/2009, at 10:31 PM, Mads Paulin wrote:

Adding a node object through this method creates a node object in the
document array member with a retain count of 2. The remove:sender method correctly removes the object from the document's array but only decrements the node object's retain count to 1 - meaning that the objects are never dealloc. As I see it, this is a memory leak in NSTreeController as all "my"
external references to the Node objects are lost.


You can't meaningfully debug by peeking at retain counts. Instead try logging from the -dealloc method if possible, or use the leaks Instrument to find out if the objects are really not being deallocated. There's no requirement that the retain count is actually decremented to 0 - the code may merely predict that it would be and call -dealloc, rather than actually doing it.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to