From 6dc5fd71817cd74e4326663cdf4b1ec1c6864510 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 19 Feb 2001 12:29:39 +0000 Subject: [PATCH] temp (?) fix for wxYield() calls from other threads git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/app.cpp | 8 ++++++++ src/gtk1/app.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) 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; -- 2.45.2