summaryrefslogtreecommitdiff
path: root/src/cairo-clip.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-08-28 15:50:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-08-29 17:07:39 +0100
commitd7d6f75ed26bc3ea040c618442ba71c89633ac7b (patch)
tree78f554b3510b463a0ee6ca8169e769be763b8533 /src/cairo-clip.c
parent52e5ce3a36ab1cd7da25056df7f12ac0b23e410d (diff)
[clip] Fix refleak of previous clipping surfaces.
When combining previous clip masks, we leaked a referenced due to not destroying the returned reference.
Diffstat (limited to 'src/cairo-clip.c')
-rw-r--r--src/cairo-clip.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 543f8bae..7f2c8be6 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -1109,9 +1109,12 @@ _cairo_clip_path_get_surface (cairo_clip_path_t *clip_path,
prev = prev->prev;
goto NEXT_PATH;
} else {
- _cairo_pattern_init_for_surface (&pattern.surface,
- _cairo_clip_path_get_surface (prev,
- target));
+ cairo_surface_t *prev_surface;
+
+ prev_surface = _cairo_clip_path_get_surface (prev, target);
+ _cairo_pattern_init_for_surface (&pattern.surface, prev_surface);
+ cairo_surface_destroy (prev_surface);
+
cairo_matrix_init_translate (&pattern.base.matrix,
-prev->extents.x + clip_extents->x,
-prev->extents.y + clip_extents->y);