[cairo] destroying context and surface

Mike Gran spk121 at yahoo.com
Sat Oct 20 06:15:42 PDT 2012


Hi-

A quick question.

When creating a new image context, one first creates the image surface
and then creates the cairo context from the surface.
cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_A8, w, h); cairo_t *cr = cairo_create(surface);
cairo_surface_destroy(surface); cairo_destroy(cr); 
So, when tearing down, does one first destroy the cairo context and
then the cairo surface?  Or is it better to first destroy the surface
and then the context? Or does it matter?

It if doesn't matter, would it matter if it were an Xlib surface instead?

Thanks.


More information about the cairo mailing list