X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/176d98241020d28c8b7c9220389139e8dbf6a8ea..1ffc8d7a55af1c253ca363bb0fbdda26bb4c9c65:/src/gtk/app.cpp diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 9be1cb13bf..e60e5ea94c 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -224,16 +224,6 @@ static gint wxapp_idle_callback( gpointer WXUNUSED(data) ) // thread so we must lock it here ourselves. gdk_threads_enter(); - // Indicate that we are now in idle mode and event handlers - // will have to reinstall the idle handler again. - { -#if wxUSE_THREADS - wxMutexLocker lock(gs_idleTagsMutex); -#endif - g_isIdle = true; - wxTheApp->m_idleTag = 0; - } - bool moreIdles; // Send idle event to all who request them as long as @@ -245,7 +235,17 @@ static gint wxapp_idle_callback( gpointer WXUNUSED(data) ) gdk_threads_leave(); if (!moreIdles) + { +#if wxUSE_THREADS + wxMutexLocker lock(gs_idleTagsMutex); +#endif + // Indicate that we are now in idle mode and event handlers + // will have to reinstall the idle handler again. + g_isIdle = true; + wxTheApp->m_idleTag = 0; + wxAddEmissionHook(); + } // Return FALSE if no more idle events are to be sent return moreIdles; @@ -344,6 +344,9 @@ static gint wxapp_poll_func( GPollFD *ufds, guint nfds, gint timeout ) void wxapp_install_idle_handler() { + if (wxTheApp == NULL) + return; + #if wxUSE_THREADS wxMutexLocker lock(gs_idleTagsMutex); #endif