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
This commit is contained in:
Vadim Zeitlin
2012-10-22 11:21:02 +00:00
parent 7276c69c1c
commit 220dcb1a7f

View File

@@ -2283,6 +2283,12 @@ wxGraphicsBitmap wxGDIPlusRenderer::CreateSubBitmap( const wxGraphicsBitmap &bit
class wxGDIPlusRendererModule : public wxModule class wxGDIPlusRendererModule : public wxModule
{ {
public: public:
wxGDIPlusRendererModule()
{
// We must be uninitialized before GDI+ DLL itself is unloaded.
AddDependency("wxGdiPlusModule");
}
virtual bool OnInit() { return true; } virtual bool OnInit() { return true; }
virtual void OnExit() virtual void OnExit()
{ {