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
This commit is contained in:
Michael Wetherell 2005-04-30 02:09:21 +00:00
parent 543cba0252
commit 79481be2f8

View File

@ -280,19 +280,22 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
wxSetEnv(wxT("LFN"), wxT("N")); wxSetEnv(wxT("LFN"), wxT("N"));
#endif #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 // must do it before calling wxAppBase::Initialize(), because fonts are
// needed by stock lists which are created there // needed by stock lists which are created there
wxTheFontsManager = new wxFontsManager; wxTheFontsManager = new wxFontsManager;
if ( !wxAppBase::Initialize(argc, argv) ) if ( !wxAppBase::Initialize(argc, argv) )
return false;
if ( MGL_init(".", NULL) == 0 )
{ {
wxLogError(_("Cannot initialize SciTech MGL!")); delete wxTheFontsManager;
wxTheFontsManager = NULL;
wxAppBase::CleanUp(); MGL_exit();
return false; return false;
} }