Re: Programatically detect if any autorelease pool exists?
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