mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-01 07:58:04 +02:00
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:
parent
f2720e2ba1
commit
2be125817a
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue