surface: Check reference count right before free

This makes sure that nothing took a reference during finishing and during
detaching user and mime-data.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2012-09-25 11:40:22 +02:00
parent f2720e2ba1
commit 2be125817a

View file

@ -943,8 +943,6 @@ cairo_surface_destroy (cairo_surface_t *surface)
return;
_cairo_surface_finish (surface);
/* paranoid check that nobody took a reference whilst finishing */
assert (! CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count));
}
if (surface->damage)
@ -957,7 +955,9 @@ cairo_surface_destroy (cairo_surface_t *surface)
cairo_device_destroy (surface->device);
assert (surface->snapshot_of == NULL);
assert (!_cairo_surface_has_snapshots (surface));
assert (! _cairo_surface_has_snapshots (surface));
/* paranoid check that nobody took a reference whilst finishing */
assert (! CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count));
free (surface);
}