[cairo-commit] cairo/test mask.c,1.6,1.7

Carl Worth commit at pdx.freedesktop.org
Fri Jul 15 01:38:40 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv30103/test

Modified Files:
	mask.c 
Log Message:

        * test/mask.c: (set_gradient_pattern), (set_image_pattern),
        (draw): Fix a few memory leaks (missing cairo_pattern_destroy in 3
        places).


Index: mask.c
===================================================================
RCS file: /cvs/cairo/cairo/test/mask.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mask.c	8 Jul 2005 17:12:29 -0000	1.6
+++ mask.c	15 Jul 2005 08:38:38 -0000	1.7
@@ -56,6 +56,7 @@
     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 @@
 
     pattern = cairo_test_create_png_pattern (cr, png_filename);
     cairo_set_source (cr, pattern);
+    cairo_pattern_destroy (pattern);
 }
 
 static void
@@ -202,6 +204,8 @@
 
     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 @@
     }
 
     cairo_destroy (cr2);
-    cairo_surface_destroy (tmp_surface);
 
     return CAIRO_TEST_SUCCESS;
 }




More information about the cairo-commit mailing list