X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bc385ba9ebd0185d5bc3dcbf9fb3f35e3eac4d7a..15cae9eb9e277bcc3c63b3c5c20defe981660c79:/src/common/init.cpp diff --git a/src/common/init.cpp b/src/common/init.cpp index 78576fb3c5..0b9a9ae16b 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -35,7 +35,7 @@ // global vars // ---------------------------------------------------------------------------- -wxApp * WXDLLEXPORT wxTheApp = NULL; +WXDLLEXPORT wxApp *wxTheApp = NULL; wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction)NULL; @@ -48,6 +48,7 @@ class /* no WXDLLEXPORT */ wxConsoleApp : public wxApp { public: virtual int OnRun() { wxFAIL_MSG(wxT("unreachable")); return 0; } + virtual bool ProcessIdle() { return TRUE; } }; // ---------------------------------------------------------------------------- @@ -76,13 +77,6 @@ void WXDLLEXPORT wxExit() abort(); } -// Yield to other apps/messages -bool WXDLLEXPORT wxYield() -{ - // do nothing - return TRUE; -} - // Yield to other apps/messages void WXDLLEXPORT wxWakeUpIdle() { @@ -116,6 +110,7 @@ bool WXDLLEXPORT wxInitialize() return FALSE; } + wxTheApp->DoInit(); gs_nInitCount++; return TRUE; @@ -219,9 +214,8 @@ static void DoCleanUp() // continuing to use user defined log target is unsafe from now on because // some resources may be already unavailable, so replace it by something // more safe - wxLog *oldlog = wxLog::SetActiveTarget(new wxLogStderr); - if ( oldlog ) - delete oldlog; + wxLog::DontCreateOnDemand(); + delete wxLog::SetActiveTarget(new wxLogStderr); #endif // wxUSE_LOG wxModule::CleanUpModules(); @@ -231,4 +225,9 @@ static void DoCleanUp() // delete the application object delete wxTheApp; wxTheApp = (wxApp *)NULL; + +#if wxUSE_LOG + // and now delete the last logger as well + delete wxLog::SetActiveTarget(NULL); +#endif // wxUSE_LOG }