From 220dcb1a7f58c0c499938ac52ae5c8c937ffd8bc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 22 Oct 2012 11:21:02 +0000 Subject: [PATCH] Ensure the correct cleanup order for GDI+-related modules in wxMSW. GDI+ DLL could be unloaded by wxGdiPlusModule before wxGDIPlusRendererModule:: OnExit() was called, resulting in a crash when trying to call a GDI+ function from the latter. Fix this by adding a correct dependency between the modules. Closes #14769. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/graphics.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index f447d1566e..8f1844b093 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -2283,6 +2283,12 @@ wxGraphicsBitmap wxGDIPlusRenderer::CreateSubBitmap( const wxGraphicsBitmap &bit class wxGDIPlusRendererModule : public wxModule { public: + wxGDIPlusRendererModule() + { + // We must be uninitialized before GDI+ DLL itself is unloaded. + AddDependency("wxGdiPlusModule"); + } + virtual bool OnInit() { return true; } virtual void OnExit() { -- 2.49.0