• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Memory leak in NSOutlineView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Fadeing in and out
  • Next by Date: Re: C and objective C together
  • Previous by thread: Re: Cocoa & Printing
  • Next by thread: Re: Memory leak in NSOutlineView?
  • Index(es):
    • Date
    • Thread