[cairo] more quartz cleanup

Carl Worth cworth at cworth.org
Thu Aug 18 14:33:30 PDT 2005


On Thu, 18 Aug 2005 14:20:29 -0700, Josh Aas wrote:
> The attached patch does whitespace cleanup so things line up, and the
> file has been detabbed.

According to cairo/CODING_STYLE tabs are always 8 spaces, so 
detabification should not be necessary to line things up. And I
certainly will not guarantee that tabs don't come back, (they
certainly appear in any files that I edit).

> There is one thing in the patch that is not whitespace cleanup:
> 
> -	/* XXX: I assume we're leaking memory here, but I don't know
> -	 * the right call to use to clean up from CGImageCreate. */
> -	return CAIRO_STATUS_NO_MEMORY;
> +        if (surface->cgImage)
> +            CGImageRelease(surface->cgImage);
> +        return CAIRO_STATUS_NO_MEMORY;
> 
> It looks like if the cgImage gets created, we should just release it
> if the cairo_image_surface_create_for_data() call failed. I'm not sure
> why Calum didn't just do this before since if he wrote the whole file
> then he already knew about CGImageRelease(). We might do more with the
> memory mgmt in this function, but this should be good enough for now,
> avoiding the biggest leak.

This one is my fault. I fixed a bug in that it wasn't doing error
checking here, but I didn't know how to fix the leak. So thanks.
I've now committed this bug fix.

-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/20050818/268bc61e/attachment.pgp


More information about the cairo mailing list