• 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: Autorelease pools?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autorelease pools?


  • Subject: Re: Autorelease pools?
  • From: T Reaves <email@hidden>
  • Date: Thu, 18 Mar 2004 21:29:01 -0500

On Mar 18, 2004, at 9:07 PM, John Stiles wrote:

On Mar 18, 2004, at 5:47 PM, Kevin Ballard wrote:

Can anybody tell me what's the point of creating your own autorelease
pools when Cocoa automatically creates one for you?

If you make a thread, the autorelease pool for that thread isn't created for you automatically.
Or, if you write a Carbon app and use NSObjects in it, you also need to make your own autorelease pool.
If you ever see a warning in the Console about "just leaking", you've found one of these cases :)


It is also useful in cases where you know you will be creating large numbers of objects, and want more control over object life. Autorelease pools nest, so that if you create a new one, that one is used until it is released. You can create one, create a lot of objects, release that pool, and the outer pool still exits.
_______________________________________________
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: 
 >Autorelease pools? (From: Kevin Ballard <email@hidden>)
 >Re: Autorelease pools? (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Autorelease pools?
  • Next by Date: RE: Quitting screensavers programmatically
  • Previous by thread: Re: Autorelease pools?
  • Next by thread: Re: Autorelease pools?
  • Index(es):
    • Date
    • Thread