]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dialog.cpp
Use real id for wxPGCanvas
[wxWidgets.git] / src / osx / carbon / dialog.cpp
index 47795946625287f51caf09a7f21bf9cc5377e056..16a77b7ce23919e540b0f9a8a0d34ba07fd86b35 100644 (file)
@@ -34,8 +34,8 @@ void wxDialog::DoShowModal()
     SetFocus() ;
 
     WindowRef windowRef = (WindowRef) GetWXWindow();
-    WindowGroupRef windowGroup;
-    WindowGroupRef formerParentGroup;
+    WindowGroupRef windowGroup = NULL;
+    WindowGroupRef formerParentGroup = NULL;
     bool resetGroupParent = false;
 
     if ( GetParent() == NULL )
@@ -47,21 +47,14 @@ void wxDialog::DoShowModal()
     }
     BeginAppModalStateForWindow(windowRef) ;
 
-    wxEventLoop * const
-        loop = wx_static_cast(wxEventLoop *, wxEventLoop::GetActive());
-        
-    
-    wxASSERT_MSG( loop , wxT("No Event Loop in place") );
-        
-    if ( loop )
-    {
-        while ( IsModal() )
-            loop->Dispatch();
-    }
+    wxEventLoopGuarantor ensureHasLoop;
+    wxEventLoopBase * const loop = wxEventLoop::GetActive();
+    while ( IsModal() )
+        loop->Dispatch();
 
     EndAppModalStateForWindow(windowRef) ;
     if ( resetGroupParent )
     {
         SetWindowGroupParent( windowGroup , formerParentGroup );
     }
-}
\ No newline at end of file
+}