summaryrefslogtreecommitdiff
path: root/test/mask.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2005-07-15 01:38:38 +0000
committerCarl Worth <cworth@cworth.org>2005-07-15 01:38:38 +0000
commit07d09acf2a9a8341f281cfe235325a52a20cd750 (patch)
tree7e11a616cf653f11c74152d7963fb56aa74c6c83 /test/mask.c
parent3a053c1e58962c3fb9eae11954651270244cabae (diff)
Fix a few memory leaks (missing cairo_pattern_destroy in 3 places).
Diffstat (limited to 'test/mask.c')
-rw-r--r--test/mask.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/mask.c b/test/mask.c
index 89626167..bf94f716 100644
--- a/test/mask.c
+++ b/test/mask.c
@@ -56,6 +56,7 @@ set_gradient_pattern (cairo_t *cr, int x, int y)
cairo_pattern_add_color_stop_rgba (pattern, 0, 1, 1, 1, 1);
cairo_pattern_add_color_stop_rgba (pattern, 1, 0, 0, 0.4, 1);
cairo_set_source (cr, pattern);
+ cairo_pattern_destroy (pattern);
}
static void
@@ -65,6 +66,7 @@ set_image_pattern (cairo_t *cr, int x, int y)
pattern = cairo_test_create_png_pattern (cr, png_filename);
cairo_set_source (cr, pattern);
+ cairo_pattern_destroy (pattern);
}
static void
@@ -202,6 +204,8 @@ draw (cairo_t *cr, int width, int height)
tmp_pattern = cairo_pattern_create_for_surface (tmp_surface);
cairo_set_source (cr, tmp_pattern);
+ cairo_pattern_destroy (tmp_pattern);
+ cairo_surface_destroy (tmp_surface);
for (k = 0; k < ARRAY_SIZE (clip_funcs); k++) {
for (j = 0; j < ARRAY_SIZE (mask_funcs); j++) {
@@ -234,7 +238,6 @@ draw (cairo_t *cr, int width, int height)
}
cairo_destroy (cr2);
- cairo_surface_destroy (tmp_surface);
return CAIRO_TEST_SUCCESS;
}