[cairo] Making it easier to track down errors

Carl Worth cworth at cworth.org
Fri Jun 17 11:28:58 PDT 2005


On Fri, 17 Jun 2005 08:40:32 -0400, Mike Shaver wrote:
> If you're referring to C++-style exceptions, I think that it's not
> safe for the language bindings to raise  them from the error hook. 
> While the immediate caller of _cairo_error might well have done all
> its cleanup, it's not necessarily the case that the rest of the calls
> in the chain leading from binding code will have done theirs.  Since
> the cairo library itself is not exception-aware, I think you'll end up
> with leaks or crashes.

Actually, I think the cairo implementation will work for this. Cairo
doesn't immediately call into the error notify function as soon as it
detects something wrong. Instead, all of the function calls leading to
the error return an error status value and do all necessary
unwinding. Only when the error status reaches the toplevel cairo entry
point, and that function has done its unwinding, only then are
_cairo_error and the user's error notify function called.

-Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050617/2e51ad8d/attachment.pgp


More information about the cairo mailing list