diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2012-05-25 16:00:38 -0400 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2012-05-25 16:36:46 -0400 |
commit | 9d9000cfd77bec72b39ee6fd1b4f8893c56bb27b (patch) | |
tree | f2806c5c8f7fda7023138588595eb0dc04edca20 /tests | |
parent | a7bfba3ecef5d821fb14a9723746fde9665e1f38 (diff) | |
download | gobject-introspection-9d9000cfd77bec72b39ee6fd1b4f8893c56bb27b.tar.gz |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scanner/regress.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } /** |