From c124a43fc1aab3f76cfdf20059a6449446c2a498 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 7 Mar 2020 11:29:14 +0100 Subject: [PATCH] Fix disposing private fonts in GDI+ renderer PrivateFontCollection with installed private fonts has to be deleted when GDI+ is still active, otherwise access violation exception is thrown. --- src/msw/graphics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 14342a7dad..4261cebf3f 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -2492,9 +2492,6 @@ void wxGDIPlusRenderer::Unload() { if ( m_gditoken ) { - GdiplusShutdown(m_gditoken); - m_gditoken = 0; - #if wxUSE_PRIVATE_FONTS if ( gs_privateFonts ) { @@ -2505,6 +2502,9 @@ void wxGDIPlusRenderer::Unload() gs_pFontFamily = NULL; } #endif // wxUSE_PRIVATE_FONTS + + GdiplusShutdown(m_gditoken); + m_gditoken = 0; } m_loaded = -1; // next Load() will try again }