]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/app.cpp
show the "Window" menu only when we have any MDI children, it's unnecessary otherwise...
[wxWidgets.git] / src / x11 / app.cpp
index dad65db005e1cabb283c6b9143cf6b24e488f319..4c9868ce0c98d82ce22c26087c671eb3912a98af 100644 (file)
@@ -25,6 +25,7 @@
     #include "wx/memory.h"
     #include "wx/gdicmn.h"
     #include "wx/module.h"
+    #include "wx/crt.h"
 #endif
 
 #include "wx/evtloop.h"
@@ -792,14 +793,7 @@ bool wxApp::Yield(bool onlyIfNeeded)
 
         // Make sure we have an event loop object,
         // or Pending/Dispatch will fail
-        wxEventLoopBase * const eventLoop = wxEventLoop::GetActive();
-        wxEventLoop* newEventLoop = NULL;
-        if (!eventLoop)
-        {
-            newEventLoop = new wxEventLoop;
-            wxEventLoop::SetActive(newEventLoop);
-        }
-
+       wxEventLoopGuarantor dummyLoopIfNeeded;
         // Call dispatch at least once so that sockets
         // can be tested
         wxTheApp->Dispatch();
@@ -812,12 +806,6 @@ bool wxApp::Yield(bool onlyIfNeeded)
 #endif
         ProcessIdle();
 
-        if (newEventLoop)
-        {
-            wxEventLoop::SetActive(NULL);
-            delete newEventLoop;
-        }
-
         s_inYield = false;
     }