diff options
author | Uli Schlachter <psychon@znc.in> | 2010-12-25 23:39:21 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2010-12-29 17:16:51 +0100 |
commit | 59ac884c607c024d0608cf7dec52509d9e9e328e (patch) | |
tree | eca3243008a61bba9a4d51a2c7260ad28a48d423 /src | |
parent | a4ae7d59be2e545afc30c35b2235b89860e2003a (diff) | |
download | cairo-59ac884c607c024d0608cf7dec52509d9e9e328e.tar.gz |
Verify that surfaces leak no snapshots
Finished surfaces should own no snapshots, because finished surfaces
can't be used as sources, thus their snapshots would never be used.
When free'ing the surface in cairo_surface_destroy(), it should have
no snapshots, or they will be leaked.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-surface.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 01ea27a97..bc80d08df 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -654,6 +654,9 @@ cairo_surface_destroy (cairo_surface_t *surface) if (surface->owns_device) cairo_device_destroy (surface->device); + assert (surface->snapshot_of == NULL); + assert (!_cairo_surface_has_snapshots (surface)); + free (surface); } slim_hidden_def(cairo_surface_destroy); @@ -726,6 +729,9 @@ cairo_surface_finish (cairo_surface_t *surface) if (unlikely (status)) status = _cairo_surface_set_error (surface, status); } + + assert (surface->snapshot_of == NULL); + assert (!_cairo_surface_has_snapshots (surface)); } slim_hidden_def (cairo_surface_finish); |