• 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
Re: NSDirectoryEnumerator and URLs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDirectoryEnumerator and URLs


  • Subject: Re: NSDirectoryEnumerator and URLs
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 13 Jan 2010 13:35:47 -0800

On Jan 13, 2010, at 10:32, Jamie Hardt wrote:

> I'm using a directory enumerator to recurse through a series of directories, and it always fails after going through a certain number of enumerations.  If I enumerate through the same directory over and over, it tends to fail in about the same place, but if I enumerate through other directories, it will fail but after completing a different number of enumerations, so I don't think it's necessarily a memory thing or something wrong with my file system.

On the contrary, that behavior sounds *exactly* like a memory thing, or at least like a memory management problem.

I notice that you don't take ownership of (retain) the NSDirectoryEnumerator object. There's no obvious reason why it should disappear before the next "regular" draining of its autorelease pool, but perhaps something is triggering an early draining.

Also, if there happened to be any memory management bugs in the NSDirectoryEnumerator class itself, code like yours (using a subsidiary autorelease pool, in which any autoreleased memory allocated by the enumerator during the enumeration would be placed) would expose it.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >NSDirectoryEnumerator and URLs (From: Jamie Hardt <email@hidden>)

  • Prev by Date: NSArrayControllers not repopulating after NSPersistentDocument load
  • Next by Date: Image of minimized window using 10.4 APIs
  • Previous by thread: Re: NSDirectoryEnumerator and URLs (PS) [resolved]
  • Next by thread: NSScroller knob reposition
  • Index(es):
    • Date
    • Thread