Re: carbon throwing objc exceptions
Re: carbon throwing objc exceptions
- Subject: Re: carbon throwing objc exceptions
- From: Eric Schlegel <email@hidden>
- Date: Mon, 14 Sep 2009 15:15:39 -0700
On Sep 14, 2009, at 2:24 PM, Joel Reymont wrote:
Sean,
On Sep 14, 2009, at 9:57 PM, Shawn Erickson wrote:
Why are you attempting to catch the except at all? It looks like no
attempt is made to deal with the exception and in general
exceptions in Cocoa are truly exceptional and imply a mistake by
the programmer.
Quoting from an existing bug [2]:
"If a cocoa exception is thrown in the middle of a gecko callback,
really bad things happen (like you can no longer load any pages, for
example). Cocoa exceptions are basically setjmp/longjmp, and,
presumably, without a handler, will jump back to the main event
loop's default handler. This will unwind the stack without any stack
cleanup."
Generally, exceptions should be caught at the level of the callback,
rather than around the lower-level functions that you're calling in
CoreFoundation.
As to whether the CF function you're calling could actually throw an
exception, I can't say for sure, although it would be surprising. I
don't think CoreFoundation throws exceptions in general. However, the
source is public; you could download it and determine the answer
yourself.
-eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden