X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07f5b19a15a8664abad7b5176c0260aacbbbc174..37e2cb08cd1910ec5a14b38f0addfc6e2e8e172e:/src/gtk/app.cpp diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 7bc83fdbd7..c0004485a6 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -49,6 +49,8 @@ wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NUL extern bool g_isIdle; +bool g_mainThreadLocked = FALSE; + //----------------------------------------------------------------------------- // local functions //----------------------------------------------------------------------------- @@ -200,6 +202,8 @@ gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) ) // unblock other threads wishing to do some GUI things wxMutexGuiLeave(); + + g_mainThreadLocked = TRUE; // wake up other threads wxUsleep( 1 ); @@ -207,6 +211,8 @@ gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) ) // block other thread again wxMutexGuiEnter(); + g_mainThreadLocked = FALSE; + wxapp_install_thread_wakeup(); // release lock again @@ -476,17 +482,16 @@ bool wxApp::Initialize() wxPendingEventsLocker = new wxCriticalSection(); #endif -/* - wxTheFontNameDirectory = new wxFontNameDirectory; - wxTheFontNameDirectory->Initialize(); -*/ - wxTheColourDatabase = new wxColourDatabase( wxKEY_STRING ); wxTheColourDatabase->Initialize(); wxInitializeStockLists(); wxInitializeStockObjects(); +#if wxUSE_WX_RESOURCES + wxInitializeResourceSystem(); +#endif + wxModule::RegisterModules(); if (!wxModule::InitializeModules()) return FALSE; @@ -497,15 +502,15 @@ void wxApp::CleanUp() { wxModule::CleanUpModules(); +#if wxUSE_WX_RESOURCES + wxCleanUpResourceSystem(); +#endif + if (wxTheColourDatabase) delete wxTheColourDatabase; + wxTheColourDatabase = (wxColourDatabase*) NULL; -/* - if (wxTheFontNameDirectory) delete wxTheFontNameDirectory; - wxTheFontNameDirectory = (wxFontNameDirectory*) NULL; -*/ - wxDeleteStockObjects(); wxDeleteStockLists();