shared/cairo-util: Release any fontmap laying around

This is particularly useful when using the weston-editor which seems to
cause an issue with cairo_debug_reset_static_data(), as that still seems
to find out there are references laying around, causing a crash when
exiting:

 ../../../../src/cairo-hash.c:217: _cairo_hash_table_destroy: Assertion
 `hash_table->live_entries == 0' failed

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2022-07-12 14:23:57 +03:00
parent cfe35b591f
commit fb57ce17ef
1 changed files with 4 additions and 0 deletions

View File

@ -691,6 +691,10 @@ theme_get_location(struct theme *t, int x, int y,
void
cleanup_after_cairo(void)
{
/* some clients, particular weston-editor, still creates indirectly a
* new font map; this makes sure we untie that up and avoid an assert
* from cairo */
pango_cairo_font_map_set_default(NULL);
cairo_debug_reset_static_data();
#ifdef HAVE_PANGO
FcFini();