• 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: [OT] Retain count riddle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Re: [OT] Retain count riddle (From: Christopher Behm <email@hidden>)

  • Prev by Date: delegate method first responder
  • Next by Date: Re: NSDocument-based app limitations?
  • Previous by thread: Re: [OT] Retain count riddle
  • Next by thread: Re: [OT] Retain count riddle
  • Index(es):
    • Date
    • Thread