• 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: Programatically detect if any autorelease pool exists?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programatically detect if any autorelease pool exists?


  • Subject: Re: Programatically detect if any autorelease pool exists?
  • From: Jonathon Mah <email@hidden>
  • Date: Wed, 6 Sep 2006 15:23:30 +0930

Hi Sean,
On 2006-09-06, at 05:08, Sean McBride wrote:

Is there a way to programatically detect if any autorelease pool exists?

+[NSAutoreleasePool autoreleasePoolExists]

Currently, the library is creating its own NSAutoreleasePool then
releasing it later.  This works great in the first case (since cross
platform C++ apps should not be concerned with the fact that the
library's implementation needs an autorelease pool present) but is
problematic in the second case.

Without knowing much about the problem, I'd be content to require the user to make their own autorelease pool in main(), since otherwise you're probably looking at needing really ugly code. Creating the pool in main() won't help memory management though, since objects will only be released on exit --- it'd only be useful to suppress the autorelease warnings.


But surely the run loop creates a pool automatically; how does it work "normally"?


Jonathon Mah email@hidden


_______________________________________________ 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
References: 
 >Programatically detect if any autorelease pool exists? (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Re: Programatically detect if any autorelease pool exists?
  • Next by Date: Re: Selection marquees (rubberband selection?)
  • Previous by thread: Re: Programatically detect if any autorelease pool exists?
  • Next by thread: InterfaceBuilder programming info
  • Index(es):
    • Date
    • Thread