X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e819ca3aa5a6da0944180d0da45102457bffcff5..c4264a8317caf3a5813adc2bc5ddb755595e6481:/src/common/appbase.cpp

diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp
index 34dbcf0089..194d0793ac 100644
--- a/src/common/appbase.cpp
+++ b/src/common/appbase.cpp
@@ -345,8 +345,11 @@ bool wxAppConsoleBase::Dispatch()
 bool wxAppConsoleBase::Yield(bool onlyIfNeeded)
 {
     wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
+    if ( loop )
+       return loop->Yield(onlyIfNeeded);
 
-    return loop && loop->Yield(onlyIfNeeded);
+    wxScopedPtr<wxEventLoopBase> tmpLoop(CreateMainLoop());
+    return tmpLoop->Yield(onlyIfNeeded);
 }
 
 void wxAppConsoleBase::WakeUpIdle()