diff options
author | Henry Song <henry.song@samsung.com> | 2012-06-14 23:07:34 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-14 23:07:34 +0100 |
commit | 9bc1ea44316d448110c1d128a9f74147f775943d (patch) | |
tree | 8f00662b854faa7971926d115387b9baf7d310e0 /src/cairo-surface-subsurface.c | |
parent | 13ba74a00d34b232f76ecb9efc96eea1227ce649 (diff) | |
download | cairo-9bc1ea44316d448110c1d128a9f74147f775943d.tar.gz |
subsurface: Disable subsurface-set-snapshot as it creates a ref cycle
_cairo_surface_subsurface_set_snapshot () sets the subsurface as the
snapshot of its target. This creates a reference cycle (as the target
is already referenced by the surface) and thus a memory leak (assuming
the likely case that user doesn't call finish).
Test case: subsurface-similar-repeat.
So make this call as a no-op for the time being until the bug is fixed.
Diffstat (limited to 'src/cairo-surface-subsurface.c')
-rw-r--r-- | src/cairo-surface-subsurface.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cairo-surface-subsurface.c b/src/cairo-surface-subsurface.c index 90440c7c7..7ceef1120 100644 --- a/src/cairo-surface-subsurface.c +++ b/src/cairo-surface-subsurface.c @@ -557,6 +557,12 @@ _cairo_surface_subsurface_set_snapshot (cairo_surface_t *surface, TRACE ((stderr, "%s: target=%d, snapshot=%d\n", __FUNCTION__, ss->target->unique_id, snapshot->unique_id)); + /* FIXME: attaching the subsurface as a snapshot to its target creates + * a reference cycle. Let's make this call as a no-op until that bug + * is fixed. + */ + return; + if (ss->snapshot) _cairo_surface_detach_snapshot (ss->snapshot); |