]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure that an event loop exists in ShowViewOrWindowWithEffect().
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 6 Oct 2009 00:08:10 +0000 (00:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 6 Oct 2009 00:08:10 +0000 (00:08 +0000)
We may not have an event loop yet if wxWindow::ShowWithEffect() is called
during the application startup, create a temporary event loop instead of
crashing in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/window.mm

index 6488703c092624b327620b5a71fe6c006158fcac..26d42af3f6a5ee4df9b0e55228b972f54078d172 100644 (file)
@@ -1395,9 +1395,12 @@ wxWidgetCocoaImpl::ShowViewOrWindowWithEffect(wxWindow *win,
     //
     // notice that because the default animation mode is NSAnimationBlocking,
     // no user input events ought to be processed from here
-    wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
-    while ( ![animDelegate isDone] )
-        loop->Dispatch();
+    {
+        wxEventLoopGuarantor ensureEventLoopExistence;
+        wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
+        while ( ![animDelegate isDone] )
+            loop->Dispatch();
+    }
 
     if ( !show )
     {