From 79481be2f8dca35f3c0ae4343ce6f00bddb16305 Mon Sep 17 00:00:00 2001 From: Michael Wetherell Date: Sat, 30 Apr 2005 02:09:21 +0000 Subject: [PATCH] Call MGL_init earlier in wxApp::Initialize to avoid crash git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mgl/app.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/mgl/app.cpp b/src/mgl/app.cpp index b76b94ddd5..62207edf46 100644 --- a/src/mgl/app.cpp +++ b/src/mgl/app.cpp @@ -280,19 +280,22 @@ bool wxApp::Initialize(int& argc, wxChar **argv) wxSetEnv(wxT("LFN"), wxT("N")); #endif + // intialize MGL before creating wxFontsManager since it uses MGL funcs + if ( MGL_init(".", NULL) == 0 ) + { + wxLogError(_("Cannot initialize SciTech MGL!")); + 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) ) - return false; - - if ( MGL_init(".", NULL) == 0 ) { - wxLogError(_("Cannot initialize SciTech MGL!")); - - wxAppBase::CleanUp(); - + delete wxTheFontsManager; + wxTheFontsManager = NULL; + MGL_exit(); return false; }