[cairo] Do I Need To Reference The Device?

Behdad Esfahbod behdad at behdad.org
Sun Mar 8 00:22:34 PST 2015

On 15-03-07 08:10 PM, Lawrence D'Oliveiro wrote:
> Do I need to call cairo_device_reference on the result from
> cairo_surface_get_device
> <http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-device>
> if I want to keep the reference? In every other analogous case I can
> find, e.g. cairo_get_source
> <http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-source>,
> it is made clear you must get your own reference to the returned
> object, but not here.

Yes, you need to reference that.

> (I have just in the last few hours fixed a few crashes in Qahirah from
> neglecting to observe these rules.)
> Is this an omission in the documentation?

Sounds about it.  Patches welcome!

> Thanks for any clarification.


More information about the cairo mailing list