X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/924ef85080e1b257900110f0c3298a8c19acaeab..c2754d29034199bc158fc079f91c7bca15d40037:/src/gtk1/app.cpp diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 965f9967f2..c0004485a6 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -49,6 +49,8 @@ wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NUL extern bool g_isIdle; +bool g_mainThreadLocked = FALSE; + //----------------------------------------------------------------------------- // local functions //----------------------------------------------------------------------------- @@ -111,7 +113,7 @@ void wxWakeUpIdle() { #if wxUSE_THREADS if (!wxThread::IsMain()) - gdk_threads_enter(); + wxMutexGuiEnter(); #endif if (g_isIdle) @@ -119,7 +121,7 @@ void wxWakeUpIdle() #if wxUSE_THREADS if (!wxThread::IsMain()) - gdk_threads_leave(); + wxMutexGuiLeave(); #endif } @@ -194,13 +196,14 @@ gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) ) // when getting called from GDK's time-out handler // we are no longer within GDK's grab on the GUI // thread so we must lock it here ourselves - gdk_threads_enter(); wxapp_uninstall_thread_wakeup(); // unblock other threads wishing to do some GUI things wxMutexGuiLeave(); + + g_mainThreadLocked = TRUE; // wake up other threads wxUsleep( 1 ); @@ -208,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 @@ -477,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; @@ -498,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();