From 9d9000cfd77bec72b39ee6fd1b4f8893c56bb27b Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 25 May 2012 16:00:38 -0400 Subject: tests: Fix a memory leak We need to unref the cairo surface here, as we are making the context be the sole owner of it. https://bugzilla.gnome.org/show_bug.cgi?id=671687 --- tests/scanner/regress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c index bcab7f8b..ca8d6ef8 100644 --- a/tests/scanner/regress.c +++ b/tests/scanner/regress.c @@ -294,8 +294,11 @@ cairo_t * regress_test_cairo_context_full_return (void) { cairo_surface_t *surface; + cairo_t *cr; surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 10, 10); - return cairo_create (surface); + cr = cairo_create (surface); + cairo_surface_destroy (surface); + return cr; } /** -- cgit v1.2.1