summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2013-01-07 02:13:11 -0600
committerBehdad Esfahbod <behdad@behdad.org>2013-01-07 02:13:11 -0600
commit96f6c065deae8093f3c27e040ac1586de6113309 (patch)
treef971589f1d7e28c074193597419ec6bd25b62a17
parent87ed96661e6217727f59fe372b47ff66ccbf578b (diff)
downloadpango-96f6c065deae8093f3c27e040ac1586de6113309.tar.gz
Fix test leaks
Valgrinding.... Apparently somewhere some memory corruption happens. Argh...
-rw-r--r--tests/test-pangocairo-threads.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test-pangocairo-threads.c b/tests/test-pangocairo-threads.c
index b33de73e..520f7c3f 100644
--- a/tests/test-pangocairo-threads.c
+++ b/tests/test-pangocairo-threads.c
@@ -58,6 +58,10 @@ thread_func (gpointer data)
for (i = 0; i < num_iters; i++)
draw (cr, layout, i);
+ g_object_unref (layout);
+
+ cairo_destroy (cr);
+
return 0;
}
@@ -92,6 +96,8 @@ main (int argc, char **argv)
for (i = 0; i < num_threads; i++)
g_thread_join (g_ptr_array_index (threads, i));
+ g_ptr_array_free (threads, TRUE);
+
/* Now, draw a reference image and check results. */
{
cairo_surface_t *ref_surface = create_surface ();
@@ -102,6 +108,9 @@ main (int argc, char **argv)
draw (cr, layout, num_iters - 1);
+ g_object_unref (layout);
+ cairo_destroy (cr);
+
/* cairo_surface_write_to_png (ref_surface, "test-pangocairo-threads-reference.png"); */
g_assert (WIDTH == cairo_format_stride_for_width (CAIRO_FORMAT_A8, WIDTH));
@@ -117,8 +126,15 @@ main (int argc, char **argv)
cairo_surface_write_to_png (surface, "test-pangocairo-threads-failed.png");
return 1;
}
+ cairo_surface_destroy (surface);
}
+
+ cairo_surface_destroy (ref_surface);
}
+ g_ptr_array_free (surfaces, TRUE);
+
+ pango_cairo_font_map_set_default (NULL);
+
return 0;
}