Detach snapshots after flushing in cairo_surface_finish()

Flushing a surface can attach snapshots to it, thus we have to detach
the snapshots after the flush, to make sure they aren't leaked.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-12-26 11:04:30 +01:00 committed by Andrea Canciani
parent 59ac884c60
commit 7f68461e0b

View file

@ -715,12 +715,13 @@ cairo_surface_finish (cairo_surface_t *surface)
if (surface->finished)
return;
cairo_surface_flush (surface);
/* update the snapshots *before* we declare the surface as finished */
_cairo_surface_detach_snapshots (surface);
if (surface->snapshot_of != NULL)
_cairo_surface_detach_snapshot (surface);
cairo_surface_flush (surface);
surface->finished = TRUE;
/* call finish even if in error mode */