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.
This commit is contained in:
Artur Wieczorek
2020-03-07 11:29:14 +01:00
parent bf6dae2151
commit c124a43fc1

View File

@@ -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
}