• 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: Newbie question: autorelease sends autorelease
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question: autorelease sends autorelease


  • Subject: Re: Newbie question: autorelease sends autorelease
  • From: j o a r <email@hidden>
  • Date: Wed, 22 Sep 2004 08:44:10 +0200

I don't know how this is implemented. I would guess (a), or perhaps (b) - but very unlikely (c).
I would be interested to know why it matters to you though? Are you tracking down leaks? I would view this as an implementation detail for Apple to worry about...


If you're curious I think that you could use +showPools from NSDebug.h to figure out how it is handled.

j o a r

On 2004-09-22, at 05.25, James Bucanek wrote:

First question: What happens to an object that gets autoreleased during the dealloc message of another object that is being released by an autorelease pool?

Example:

Object a retains object b.

Object a gets autoreleased.

When the NSAutoreleasePool gets dealloc'd, a gets released.

The dealloc handler for a sends an autoreleas to b.

What happens to b?

(1) b gets added to the same NSAutoreleasePool that a belongs to, and that NSAutoreleasePool repeatedly releases objects until it is empty.

(2) b gets added to some other (next higher?) autorelease pool.

(3) b leaks.

_______________________________________________ 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
  • Follow-Ups:
    • Re: Newbie question: autorelease sends autorelease
      • From: Chris Ridd <email@hidden>
References: 
 >Newbie question: autorelease sends autorelease (From: James Bucanek <email@hidden>)

  • Prev by Date: Re: Newbie question: autorelease sends autorelease
  • Next by Date: Re: How to validate NSComboBoxCell selection
  • Previous by thread: Re: Newbie question: autorelease sends autorelease
  • Next by thread: Re: Newbie question: autorelease sends autorelease
  • Index(es):
    • Date
    • Thread