Skip to content

pangowin32-fontmap.c: Avoid double free in fontmap->finalize()

Chun-wei Fan requested to merge win32-avoid-double-free into main

Hi,

From the commit message:

During the implementation of loading custom fonts, I missed the fact that hash tables were free'ed in pango_win32_font_map_fini(), that was used to reload fontmaps when a custom font is loaded.

This cause problems when we needed to create and destroy fontmaps continually, as demonstrated in test-pangocairo-threads.

The g_atomic_ref_count_dec() threw out assertion messages (g_return_val_if_fail (old_value > 0, FALSE);) as a result.

With blessings, thank you!

Merge request reports