Re: CF autorelease?
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