]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure the correct cleanup order for GDI+-related modules in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Oct 2012 11:21:02 +0000 (11:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Oct 2012 11:21:02 +0000 (11:21 +0000)
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

index f447d1566ea23f233cd52611a0bd6d8409329ab3..8f1844b0937264fcc9c61a8e947b78fae14b6931 100644 (file)
@@ -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()
     {