X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c33522fca7cddc441a316f5b9fb50d7685435ba..b3cec67186d678d2c3985923bdb8c787455cf369:/src/osx/carbon/dialog.cpp diff --git a/src/osx/carbon/dialog.cpp b/src/osx/carbon/dialog.cpp index cbd77128db..16a77b7ce2 100644 --- a/src/osx/carbon/dialog.cpp +++ b/src/osx/carbon/dialog.cpp @@ -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 = static_cast(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 +}