Re: NSEnumerator retaining objects?
Re: NSEnumerator retaining objects?
- Subject: Re: NSEnumerator retaining objects?
- From: Shawn Erickson <email@hidden>
- Date: Tue, 8 Mar 2005 09:26:09 -0800
On Mar 8, 2005, at 9:20 AM, James Bucanek wrote:
I'm trying to track down some memory leaks and I'm running into
something weird. At least I think it is....
I'm running ObjectAlloc and watching the retain/release/autorelease
cycles of a few objects. I expected to see two or three events per
object, but I'm seeing thousands. When I step through the ObjectAlloc
events, it refers to code that looks like this:
1: NSEnumerator* e = [array objectEnumerator];
2: Node* node;
3: while ( (node=(Node*)[e nextObject])!=nil )
4: {
5: // do something with node
6: }
Every node object is seeing a retain followed by an autorelease on
line 3. Does NSEnumerator retain every object it iterates through,
then autorelease it on the next pass through the loop?
Possibly.
I have several concerns with this,
What concerns? I assume performance..?
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden