• 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: newbie question on 'Cocoa Programming for Mac OS X'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: newbie question on 'Cocoa Programming for Mac OS X' (From: "Lachlan O'Dea" <email@hidden>)

  • Prev by Date: [OT] English, Was: Memory Mania Revisited
  • Next by Date: AppleScript Question
  • Previous by thread: Re: newbie question on 'Cocoa Programming for Mac OS X'
  • Next by thread: Re: newbie question on 'Cocoa Programming for Mac OS X'
  • Index(es):
    • Date
    • Thread