Re: [OT] Retain count riddle
Re: [OT] Retain count riddle
- Subject: Re: [OT] Retain count riddle
- From: Shawn Erickson <email@hidden>
- Date: Tue, 30 Mar 2004 12:43:35 -0800
On Mar 30, 2004, at 12:23 PM, Christopher Behm wrote:
Well, sub in your arguments to the macro:
[[path lastPathComponent] retain];
[m_Path release];
m_Path = [path lastPathComponent];
If lastPathComponent returns a new object at each call (and it
probably does, likely an autoreleased string), then you'd have your
problem.
Even if it returned the same object it likely would have done a retain
/ autorelease pair internally. So the caller would need an extra retain
to trump the pending release.
-Shawn
_______________________________________________
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.