extern bool g_isIdle;
+bool g_mainThreadLocked = FALSE;
+
//-----------------------------------------------------------------------------
// local functions
//-----------------------------------------------------------------------------
{
#if wxUSE_THREADS
if (!wxThread::IsMain())
- gdk_threads_enter();
+ wxMutexGuiEnter();
#endif
if (g_isIdle)
#if wxUSE_THREADS
if (!wxThread::IsMain())
- gdk_threads_leave();
+ wxMutexGuiLeave();
#endif
}
// 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 );
// block other thread again
wxMutexGuiEnter();
+ g_mainThreadLocked = FALSE;
+
wxapp_install_thread_wakeup();
// release lock again
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;
{
wxModule::CleanUpModules();
+#if wxUSE_WX_RESOURCES
+ wxCleanUpResourceSystem();
+#endif
+
if (wxTheColourDatabase)
delete wxTheColourDatabase;
+
wxTheColourDatabase = (wxColourDatabase*) NULL;
-/*
- if (wxTheFontNameDirectory) delete wxTheFontNameDirectory;
- wxTheFontNameDirectory = (wxFontNameDirectory*) NULL;
-*/
-
wxDeleteStockObjects();
wxDeleteStockLists();
int wxEntry( int argc, char *argv[] )
{
#if wxUSE_THREADS
- g_thread_init(NULL);
+ /* GTK 1.2 up to version 1.2.3 has broken threads */
+ if ((gtk_major_version == 1) &&
+ (gtk_minor_version == 2) &&
+ (gtk_micro_version < 4))
+ {
+ printf( "wxWindows warning: Disabled GUI threading due to outdated GTK version\n" );
+ }
+ else
+ {
+ g_thread_init(NULL);
+ }
#endif
gtk_set_locale();