diff --git a/test/source-clip-scale.c b/test/source-clip-scale.c index 4c5569546..6434eb0a3 100644 --- a/test/source-clip-scale.c +++ b/test/source-clip-scale.c @@ -48,6 +48,7 @@ draw (cairo_t *cr, int width, int height) CAIRO_CONTENT_COLOR_ALPHA, SIZE, SIZE); cr2 = cairo_create (source); + cairo_surface_destroy (source); /* Fill the source surface with green */ cairo_set_source_rgb (cr2, 0, 1, 0); @@ -74,11 +75,10 @@ draw (cairo_t *cr, int width, int height) /* Now draw the source surface onto the destination with scaling. */ cairo_scale (cr, 2.0, 1.0); - cairo_set_source_surface (cr, source, 0, 0); - cairo_paint (cr); - + cairo_set_source_surface (cr, cairo_get_target (cr2), 0, 0); cairo_destroy (cr2); - cairo_surface_destroy (source); + + cairo_paint (cr); return CAIRO_TEST_SUCCESS; }