I've a problem with cairo_debug_reset_static_data() function when I combine both pango lib and cairo as I am getting the following assertion when its get called.
draw: cairo-hash.c:217: _cairo_hash_table_destroy: Assertion `hash_table->live_entries == 0' failed.
Here's the code I took from the following post: where some one had similar problem but they have not shared any working solution there(I already tried solution from the post, but it did not work). If we remove the commented lines then there is assertion.
#include <cairo.h>
#include <pango/pangocairo.h>
int
main (int argc, char *argv[])
{
cairo_surface_t *surface;
cairo_t *context;
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 120, 120);
context = cairo_create(surface);
PangoRectangle extents;
PangoLayout *layout;
PangoFontDescription *desc;
layout = pango_cairo_create_layout (context);
desc = pango_font_description_from_string("Inconsolata 12");
pango_layout_set_font_description(layout, desc);
pango_font_description_free(desc);
pango_layout_set_markup(layout, "hello", -1);
//pango_layout_get_pixel_extents(layout, &extents, NULL);
//pango_cairo_show_layout(context, layout);
g_object_unref(layout);
cairo_destroy(context);
cairo_surface_destroy(surface);
cairo_debug_reset_static_data();
return(0);
}
I have tried to play around it to fix this problem, and also searched their documentation but could not find anything useful. Some one with expertise on pangocairo, please shed some light and point me to right direction.
Thanks