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: AgentM <email@hidden>
- Date: Wed, 6 Sep 2006 12:56:51 -0400
On Sep 6, 2006, at 12:34 , Sean McBride wrote:
you'll see in main() that there are a bunch of objects created,
then the
Start() method is called to start the event loop. All the objects
created before Start() are possibly implemented using Cocoa, or call
other Cocoa code, and thus may autorelease objects. The Start()
method
calls [NSApp run] which will create and destroy pools for every event,
if I understand correctly. So a pool needs to exist pretty much by
the
beginning of main(), since any vtk object created may potentially
autorelease an object. Once Start() is called, the regular Cocoa pool
system starts. So I think in reality there will be few leaks: only
objects autoreleased before Start() is invoked. Hmmmm, I wonder if I
could -release my 'pool of last resort' just before calling [NSApp
run]
in Start()?
You can always take the libSDL route and macro-phize main():
http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/include/SDL_main.h?
rev=1.17&content-type=text/x-cvsweb-markup
_______________________________________________
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