Commit 96f6c065 authored by Behdad Esfahbod's avatar Behdad Esfahbod

Fix test leaks

Valgrinding....  Apparently somewhere some memory corruption happens.
Argh...
parent 87ed9666
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment