mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-20 12:01:34 +00:00
font/freetype: introduce mutexes to ensure thread safety of Library and Face
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 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.
This commit is contained in:
@@ -50,7 +50,7 @@ pub const InitError = Library.InitError;
|
||||
|
||||
/// Initialize a new SharedGridSet.
|
||||
pub fn init(alloc: Allocator) InitError!SharedGridSet {
|
||||
var font_lib = try Library.init();
|
||||
var font_lib = try Library.init(alloc);
|
||||
errdefer font_lib.deinit();
|
||||
|
||||
return .{
|
||||
|
||||
Reference in New Issue
Block a user