From 4c1a93e8d802002aae52d4f87cd7f565a07a872d Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 8 Jul 2024 13:16:51 +0100 Subject: [PATCH] FreeTypeTpeface: Avoid recreating FTTypefaceList at shutdown Calling getInstance may recreate the list singleton if it has already been destroyed. This should only happen if a Typeface instance is being destroyed after the app/plugin has been shutdown, e.g. if the typeface has static storage duration. --- modules/juce_graphics/native/juce_Fonts_freetype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_graphics/native/juce_Fonts_freetype.cpp b/modules/juce_graphics/native/juce_Fonts_freetype.cpp index f7403885a8..ba7eac879f 100644 --- a/modules/juce_graphics/native/juce_Fonts_freetype.cpp +++ b/modules/juce_graphics/native/juce_Fonts_freetype.cpp @@ -485,7 +485,7 @@ public: ~FreeTypeTypeface() override { if (doCache == DoCache::yes) - if (auto* list = FTTypefaceList::getInstance()) + if (auto* list = FTTypefaceList::getInstanceWithoutCreating()) list->removeMemoryFace (ftFace); }