The FT_Faces on unscaled_fonts created from_face are not owned by cairo and therefore must not be Done by cairo. But the code in _cairo_ft_unscaled_font_lock_face http://cgit.freedesktop.org/cairo/tree/src/cairo-ft-font.c?id=d1801c23fae3777c7c59e084894a3410f7a1f932#n564 and _has_unlocked_face http://cgit.freedesktop.org/cairo/tree/src/cairo-ft-font.c?id=d1801c23fae3777c7c59e084894a3410f7a1f932#n527 makes no distinction. (It looks like the bug may have been introduced when the from_face unscaled_fonts were included in the ft_unscaled_font_map: http://cgit.freedesktop.org/cairo/commit/?id=60cf2ef8449e1fd09fe0f2d8c8dc5fa2bb855e5a ) This could be fixed either by testing unscaled->from_face in _has_unlocked_face or by initializing lock_count = 1 for unscaled_fonts from_face and appropriately modifying the assert in _cairo_ft_unscaled_font_unlock_face.
Created attachment 20773 [details] [review] Only destroy FT_Faces created by cairo testing from_face seems clearer than using lock_count
Pushed to master. Leaving open to pick it up for 1.8. commit e4d7c87b5e449a743a68dd256faaa3242f191a44 Author: Karl Tomlinson <karlt+@karlt.net> Date: Wed Dec 17 16:40:12 2008 -0500 [ft] Don't call FT_Done_Face() on faces we did not create
Fixed in 1.8 too.
*** Bug 44859 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.