Re: newbie question on 'Cocoa Programming for Mac OS X'
Re: newbie question on 'Cocoa Programming for Mac OS X'
- Subject: Re: newbie question on 'Cocoa Programming for Mac OS X'
- From: Marcel Weiher <email@hidden>
- Date: Mon, 11 Feb 2002 09:11:31 +0100
On Monday, February 11, 2002, at 06:20 , Lachlan O'Dea wrote:
NSAutoreleasePool *localPool=[[NSAutoreleasePool alloc] init];
NSMutableArray *tempArray=[NSMutableArray array];
... work done here ...
[localPool release];
Isn't this still a problem if an exception is raised? [localPool
release] would not be executed in that case.
Yes, the release won't be executed, but Pools are linked/nested, so a
release of a pool further up the chain will get this pool as well.
Unless you manage to sidestep the top-level pools provided by Cocoa (not
a trivial task), you're safe, though the pool-cleanup will occur a tad
later than you might expect.
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
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.