From 0a88c084ad1eac30171713bb4763175107d0cd40 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 21 Dec 2025 15:08:55 +0000 Subject: [PATCH] Codechange: Don't read font os_handle on MacOS. (#14936) os_handle is never set, so there's no need to read it. --- src/os/macosx/font_osx.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/os/macosx/font_osx.cpp b/src/os/macosx/font_osx.cpp index ed3f35ca99..3cc86f6e26 100644 --- a/src/os/macosx/font_osx.cpp +++ b/src/os/macosx/font_osx.cpp @@ -215,19 +215,12 @@ public: { if (fonttype != FontType::TrueType) return nullptr; - FontCacheSubSetting *settings = GetFontCacheSubSetting(fs); - std::string font = GetFontCacheFontName(fs); if (font.empty()) return nullptr; CFAutoRelease font_ref; - if (settings->os_handle != nullptr) { - font_ref.reset(static_cast(const_cast(settings->os_handle))); - CFRetain(font_ref.get()); // Increase ref count to match a later release. - } - - if (!font_ref && MacOSVersionIsAtLeast(10, 6, 0)) { + if (MacOSVersionIsAtLeast(10, 6, 0)) { /* Might be a font file name, try load it. */ font_ref.reset(LoadFontFromFile(font)); if (!font_ref) ShowInfo("Unable to load file '{}' for {} font, using default OS font selection instead", font, FontSizeToName(fs));