From 3e3297f7a8eeb3edcd83021ac90c25fb1d3f0482 Mon Sep 17 00:00:00 2001 From: Soreepeong Date: Sun, 21 Jan 2024 04:49:51 +0900 Subject: [PATCH] Use Lock instead of .ImFont --- Dalamud/Interface/Internal/InterfaceManager.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dalamud/Interface/Internal/InterfaceManager.cs b/Dalamud/Interface/Internal/InterfaceManager.cs index 62f9145bf..159ae15bf 100644 --- a/Dalamud/Interface/Internal/InterfaceManager.cs +++ b/Dalamud/Interface/Internal/InterfaceManager.cs @@ -725,13 +725,16 @@ internal class InterfaceManager : IDisposable, IServiceType // Do not use DefaultFont, IconFont, and MonoFont. // Use font handles directly. + using var defaultFont = this.DefaultFontHandle.Lock(); + using var monoFont = this.MonoFontHandle.Lock(); + // Fill missing glyphs in MonoFont from DefaultFont - tk.CopyGlyphsAcrossFonts(this.DefaultFontHandle.ImFont, this.MonoFontHandle.ImFont, true); + tk.CopyGlyphsAcrossFonts(defaultFont, monoFont, true); // Update default font unsafe { - ImGui.GetIO().NativePtr->FontDefault = this.DefaultFontHandle.ImFont; + ImGui.GetIO().NativePtr->FontDefault = defaultFont; } // Broadcast to auto-rebuilding instances