From 1d4ad787747b5c92c3b062afde5b98c72ac4cc95 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 23 Mar 2010 08:20:49 +0000 Subject: [PATCH] test/pthread-same-source: Free source after use. --- test/pthread-same-source.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/pthread-same-source.c b/test/pthread-same-source.c index 570c91d75..50102d984 100644 --- a/test/pthread-same-source.c +++ b/test/pthread-same-source.c @@ -92,11 +92,15 @@ create_source (cairo_surface_t *similar) 2, 2); cr = cairo_create (source); + cairo_surface_destroy (source); + for (i = 0; i < 4; i++) { cairo_set_source_rgb (cr, colors[i][0], colors[i][1], colors[i][2]); cairo_rectangle (cr, i % 2, i / 2, 1, 1); cairo_fill (cr); } + + source = cairo_surface_reference (cairo_get_target (cr)); cairo_destroy (cr); return source; @@ -128,6 +132,8 @@ draw (cairo_t *cr, int width, int height) } } + cairo_surface_destroy (source); + cairo_set_source_rgb (cr, 0.5, 0.5, 0.5); cairo_paint (cr);