X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/05c9ccbe622515f0c32c996a95e86a316b13a59b..a9249b2eb2a40d8c71f828669045c4ddaa8dc5ff:/src/mgl/app.cpp?ds=sidebyside diff --git a/src/mgl/app.cpp b/src/mgl/app.cpp index 9112462198..d40b8d7062 100644 --- a/src/mgl/app.cpp +++ b/src/mgl/app.cpp @@ -461,13 +461,10 @@ void wxApp::CleanUp() wxDeleteStockObjects(); wxDeleteStockLists(); - // Can't do this in wxModule, because fonts are needed by stock lists - delete wxTheFontsManager; - wxTheFontsManager = (wxFontsManager*) NULL; - delete wxTheApp; wxTheApp = (wxApp*) NULL; + // GL: I'm annoyed ... I don't know where to put this and I don't want to // create a module for that as it's part of the core. #if wxUSE_THREADS @@ -477,10 +474,16 @@ void wxApp::CleanUp() wxSystemSettings::Done(); - delete[] wxBuffer; - wxClassInfo::CleanUpClasses(); + // Can't do this in wxModule, because fonts are needed by stock lists + // (do it after deleting wxTheApp and cleaning modules up, since somebody + // may be deleting fonts that lately) + delete wxTheFontsManager; + wxTheFontsManager = (wxFontsManager*) NULL; + + delete[] wxBuffer; + // check for memory leaks #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT if (wxDebugContext::CountObjectsLeft(TRUE) > 0)