• 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: CF autorelease?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF autorelease?


  • Subject: Re: CF autorelease?
  • From: Wade Tregaskis <email@hidden>
  • Date: Thu, 23 Apr 2009 23:56:14 -0700

Another caveat with cleanup is that it is not guaranteed to be called. For this audience, the most likely way this will bite you is when the new zero cost objective-c exceptions aren't available (i386, ppc) and an exception is thrown. If zero cost objective-c exceptions are available, then the compiler arranges to have the cleanup function called during the stack unwind.

There's enough gotchas to cleanup that I definitely wouldn't count on it for proper memory management.

Admittedly I wasn't aware of that (it's also not called if you invoke exit or abort, but that's kind of expected). However, exceptions are not usually safe to use through vanilla C code anyway, whether CF- based or otherwise, so that's a moot point (if you were using C++, you could use the template Peter Lewis suggested, and if you're using ObjC you can just autorelease directly). Good that you pointed it out though.


Wade
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: 
 >CF autorelease? (From: Todd Heberlein <email@hidden>)
 >Re: CF autorelease? (From: Michael Ash <email@hidden>)
 >Re: CF autorelease? (From: Wade Tregaskis <email@hidden>)
 >Re: CF autorelease? (From: John Engelhart <email@hidden>)

  • Prev by Date: Re: ObjectAlloc and objects that should have been released
  • Next by Date: Re: Problem implementing keyPathsForvaluesAffecting<Key>
  • Previous by thread: Re: CF autorelease?
  • Next by thread: Re: CF autorelease?
  • Index(es):
    • Date
    • Thread