From fb57ce17ef3f95027ef7eb807daa37a6ad951d10 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 12 Jul 2022 14:23:57 +0300 Subject: 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 --- shared/cairo-util.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shared') diff --git a/shared/cairo-util.c b/shared/cairo-util.c index 48b39da1..b210e93f 100644 --- a/shared/cairo-util.c +++ b/shared/cairo-util.c @@ -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(); -- cgit v1.2.1