mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-08 15:05:40 +08:00
tl;dr: FT_New_Face and FT_Done_Face require the Library to be locked for thread safety, and FT_Load_Glyph and FT_Render_Glyph and friends need the face to be locked for thread safety, since we're sharing faces across threads. For details see comments and FreeType docs @ - https://freetype.org/freetype2/docs/reference/ft2-library_setup.html#ft_library - https://freetype.org/freetype2/docs/reference/ft2-face_creation.html#ft_face --- This might resolve the issue discussed in #7016 but I wasn't able to reliably reproduce it in a way I could debug, so someone who was experiencing it should probably test this PR. Additionally I can still semi-reliably produce a crash with the GTK apprt by setting an `all:` keybind to adjust font sizes and changing the font size rapidly with many surfaces open with emojis on them. Unfortunately I can't really tell what the root cause is because the debug info is broken in QEMU. However, I do think this is a good idea for us to be thread safe with this stuff even if it isn't related to that problem.