[cairo] Re: [PATCH] return write error from cairo_*_surface_create() if output file cannot be created

Carl Worth cworth at cworth.org
Fri Jan 26 15:30:52 PST 2007


On Fri, 26 Jan 2007 18:23:31 -0500, Behdad Esfahbod wrote:
> the long run as cairo's .data usage increases... So, What about dropping
> the nil-surface idea and create an object and set its status correctly?
> Currently we use nil objects when the failure happens in the
> constructor.   If we implement the dummy-object idea I proposed in
> another thread, we can return a newly allocated dummy object of the
> correct type and set its error status to the desired error.  This way we
> don't need to add static object for any new error that is returned from
> constructors.
>
> Carl, what do you think?

I'm fine with creating new objects to hold correct error status
values.

The original nil surface idea hatched from the desire to be able to
return a non-NULL object in the face of the inability to allocate
anything. We ended up reusing the technique for errors other than
CAIRO_STATUS_NO_MEMORY, but I'm fine with actually creating an object
in that case. In fact we're already doing that in some cases, (see
_cairo_{path,pattern,rectangle_list}_create_in_error).

-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/20070126/7d3e7c67/attachment.pgp


More information about the cairo mailing list