]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/app.cpp
wx.IconBundle support
[wxWidgets.git] / src / mgl / app.cpp
index 97786a24baa36aa95059e2af5c0a4f26da35bcf3..1a614e3f81d87b2988f9bec4fcda0f7f5cd45f92 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        app.cpp
+// Name:        src/mgl/app.cpp
 // Author:      Vaclav Slavik
 //              based on GTK and MSW implementations
 // Id:          $Id$
 // Author:      Vaclav Slavik
 //              based on GTK and MSW implementations
 // Id:          $Id$
@@ -14,6 +14,7 @@
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
+#include "wx/app.h"
 
 #ifndef WX_PRECOMP
     #include "wx/settings.h"
 
 #ifndef WX_PRECOMP
     #include "wx/settings.h"
     #include "wx/dialog.h"
     #include "wx/log.h"
     #include "wx/intl.h"
     #include "wx/dialog.h"
     #include "wx/log.h"
     #include "wx/intl.h"
+    #include "wx/module.h"
 #endif
 
 #endif
 
-#include "wx/app.h"
 #include "wx/evtloop.h"
 #include "wx/evtloop.h"
-#include "wx/module.h"
 #include "wx/fontutil.h"
 #include "wx/univ/theme.h"
 #include "wx/univ/renderer.h"
 #include "wx/univ/colschem.h"
 #include "wx/sysopt.h"
 #include "wx/mgl/private.h"
 #include "wx/fontutil.h"
 #include "wx/univ/theme.h"
 #include "wx/univ/renderer.h"
 #include "wx/univ/colschem.h"
 #include "wx/sysopt.h"
 #include "wx/mgl/private.h"
+#include "wx/private/fontmgr.h"
 
 //-----------------------------------------------------------------------------
 // wxApp::Exit()
 
 //-----------------------------------------------------------------------------
 // wxApp::Exit()
@@ -124,7 +125,7 @@ class wxRootWindow : public wxWindow
             SetMGLwindow_t(MGL_wmGetRootWindow(g_winMng));
             SetBackgroundColour(wxTHEME_COLOUR(DESKTOP));
         }
             SetMGLwindow_t(MGL_wmGetRootWindow(g_winMng));
             SetBackgroundColour(wxTHEME_COLOUR(DESKTOP));
         }
-        ~wxRootWindow()
+        virtual ~wxRootWindow()
         {
             // we don't want to delete MGL_WM's rootWnd
             m_wnd = NULL;
         {
             // we don't want to delete MGL_WM's rootWnd
             m_wnd = NULL;
@@ -283,14 +284,8 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
         return false;
     }
 
         return false;
     }
 
-    // must do it before calling wxAppBase::Initialize(), because fonts are
-    // needed by stock lists which are created there
-    wxTheFontsManager = new wxFontsManager;
-
     if ( !wxAppBase::Initialize(argc, argv) )
     {
     if ( !wxAppBase::Initialize(argc, argv) )
     {
-        delete wxTheFontsManager;
-        wxTheFontsManager = NULL;
         MGL_exit();
         return false;
     }
         MGL_exit();
         return false;
     }
@@ -313,8 +308,7 @@ struct wxMGLFinalCleanup: public wxModule
 
     void OnExit()
     {
 
     void OnExit()
     {
-        delete wxTheFontsManager;
-        wxTheFontsManager = (wxFontsManager*) NULL;
+        wxFontsManager::CleanUp();
 
         wxDestroyMGL_WM();
         MGL_exit();
 
         wxDestroyMGL_WM();
         MGL_exit();
@@ -329,4 +323,3 @@ void wxApp::CleanUp()
 
     wxModule::RegisterModule(new wxMGLFinalCleanup);
 }
 
     wxModule::RegisterModule(new wxMGLFinalCleanup);
 }
-