git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48778
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void EnsureIsLoaded();
void Load();
void Unload();
void EnsureIsLoaded();
void Load();
void Unload();
+ friend class wxGDIPlusRendererModule;
void wxGDIPlusRenderer::Unload()
{
if ( m_gditoken )
void wxGDIPlusRenderer::Unload()
{
if ( m_gditoken )
GdiplusShutdown(m_gditoken);
GdiplusShutdown(m_gditoken);
+ m_gditoken = NULL;
+ }
+ m_loaded = false;
}
wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxWindowDC& dc)
}
wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxWindowDC& dc)
return wxNullGraphicsFont;
}
return wxNullGraphicsFont;
}
+// Shutdown GDI+ at app exit, before possible dll unload
+class wxGDIPlusRendererModule : public wxModule
+{
+public:
+ virtual bool OnInit() { return true; }
+ virtual void OnExit() { gs_GDIPlusRenderer.Unload(); }
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxGDIPlusRendererModule)
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxGDIPlusRendererModule, wxModule)
+
#endif // wxUSE_GRAPHICS_CONTEXT
#endif // wxUSE_GRAPHICS_CONTEXT