Memory leak in NSOutlineView?
Memory leak in NSOutlineView?
- Subject: Memory leak in NSOutlineView?
- From: Andreas Schwarz <email@hidden>
- Date: Tue, 2 Apr 2002 22:50:20 -0800
I posted some months ago about how ObjectAlloc refused to work (anything
I launched with it would just crash immediately). Well, reinstalling OS
X the other day seemed to do the trick.
Once I started using it I noticed a huge memory leak in my app... None
of the items in the NSOutlineView my app uses to display a list of files
ever get deallocated when the user chooses to view a different directory.
I make a new the root item (after releasing the old one; it should then
be deallocated and it should release its children and so on) and call
reloadData. Since it wasn't, I figured the problem was in my code
somewhere, but I couldn't see any errors I'd made, so I checked to see
what the outline view was doing.
Apparently, whenever an item is expanded, it is retained, and isn't
released until it is collapsed again. Because of this I have to
collapse all the items before reloading the data. This in itself
wouldn't be too annoying, except that calling collapseItem:(root item)
collapseChildren:YES doesn't work. I do get notifications that the
children have been collapsed, but they aren't released. They have to be
collapsed individually in order to be released.
Is this normal? I hope not! Am I doing something stupid? I hope so;
please tell me how to do it right!
Andreas Schwarz
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.