• 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: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.


  • Subject: Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
  • From: Chris Suter <email@hidden>
  • Date: Tue, 19 Dec 2006 12:52:50 +1100


On 19/12/2006, at 12:42 PM, John Stiles wrote:

Unless your app is doing very clever things, there isn't any justification for allocating an autorelease pool without releasing it.
These are particularly tricky because they are implemented in a stack, and if you do not keep the stack properly balanced, it is quite easy to make crash-inducing mistakes.

Just to add to that, you should be careful about *not* releasing autorelease pools when exceptions are involved.


- (void)myMethod
{
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

  @try {
    // do something


} @catch (NSException *e) { // Don't be tempted to stick a [pool release] in here

    @throw;
  } @finally {
   // or here

  }

  [pool release];
}

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >RE: Cocoa called from Carbon, objc_msgSend crash in 10.3.9. (From: "Matt Fox-Wilson" <email@hidden>)
 >Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9. (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
  • Next by Date: Cocoa HTTP Server & threading
  • Previous by thread: Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
  • Next by thread: RE: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
  • Index(es):
    • Date
    • Thread