X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..755c41bf1ebddab912a4bfbe460041fec28aea07:/src/common/init.cpp diff --git a/src/common/init.cpp b/src/common/init.cpp index 1af0b671f5..e1fef28c23 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -33,6 +33,12 @@ wxApp * WXDLLEXPORT wxTheApp = NULL; wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction)NULL; +#if wxUSE_THREADS + // List of events pending processing + wxList *wxPendingEvents = NULL; + wxCriticalSection *wxPendingEventsLocker = NULL; +#endif // wxUSE_THREADS + // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- @@ -40,7 +46,7 @@ wxAppInitializerFunction class /* no WXDLLEXPORT */ wxConsoleApp : public wxApp { public: - virtual int OnRun() { wxFAIL_MSG(T("unreachable")); return 0; } + virtual int OnRun() { wxFAIL_MSG(wxT("unreachable")); return 0; } }; // ---------------------------------------------------------------------------- @@ -55,24 +61,43 @@ static size_t gs_nInitCount = 0; bool WXDLLEXPORT wxInitialize() { - if ( gs_nInitCount++ ) + if ( gs_nInitCount ) { // already initialized return TRUE; } wxASSERT_MSG( !wxTheApp, - T("either call wxInitialize or create app, not both!") ); + wxT("either call wxInitialize or create app, not both!") ); + + wxClassInfo::InitializeClasses(); + + wxModule::RegisterModules(); + if ( !wxModule::InitializeModules() ) + { + return FALSE; + } wxTheApp = new wxConsoleApp; - return wxTheApp != NULL; + if ( !wxTheApp ) + { + return FALSE; + } + + gs_nInitCount++; + + return TRUE; } void WXDLLEXPORT wxUninitialize() { if ( !--gs_nInitCount ) { + wxModule::CleanUpModules(); + + wxClassInfo::CleanUpClasses(); + // delete the application object delete wxTheApp; wxTheApp = (wxApp *)NULL;