diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index e7345fe6a9..e29797d061 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -82,6 +82,14 @@ void wxExit() bool wxYield() { +#if wxUSE_THREADS + if ( !wxThread::IsMain() ) + { + // can't call gtk_main_iteration() from other threads like this + return TRUE; + } +#endif // wxUSE_THREADS + #ifdef __WXDEBUG__ static bool s_inYield = FALSE; diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index e7345fe6a9..e29797d061 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -82,6 +82,14 @@ void wxExit() bool wxYield() { +#if wxUSE_THREADS + if ( !wxThread::IsMain() ) + { + // can't call gtk_main_iteration() from other threads like this + return TRUE; + } +#endif // wxUSE_THREADS + #ifdef __WXDEBUG__ static bool s_inYield = FALSE;