]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxModule to ensure proper initialization order for wxStockGDIMac
authorPaul Cornett <paulcor@bullseye.com>
Tue, 22 Aug 2006 03:08:01 +0000 (03:08 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Tue, 22 Aug 2006 03:08:01 +0000 (03:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40735 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/gdiobj.cpp

index abd6b9da069f97f191fb5e1e2aaea609d6dab56a..436c1b612dd67925899f968bc933595e0f541e55 100644 (file)
     #include "wx/gdicmn.h"
 #endif
 
+#include "wx/module.h"
 #include "wx/mac/private.h"
 
-class wxStockGDIMac: public wxStockGDI
+class wxStockGDIMac: public wxStockGDI, public wxModule
 {
 public:
-    wxStockGDIMac();
-
     virtual const wxFont* GetFont(Item item);
 
+    virtual bool OnInit();
+    virtual void OnExit();
+
 private:
     typedef wxStockGDI super;
+    DECLARE_DYNAMIC_CLASS(wxStockGDIMac)
 };
 
-static wxStockGDIMac gs_wxStockGDIMac_instance;
+IMPLEMENT_DYNAMIC_CLASS(wxStockGDIMac, wxModule)
 
-wxStockGDIMac::wxStockGDIMac()
+bool wxStockGDIMac::OnInit()
 {
     // Override default instance
     ms_instance = this;
+    return true;
+}
+
+void wxStockGDIMac::OnExit()
+{
 }
 
 const wxFont* wxStockGDIMac::GetFont(Item item)