From: Vadim Zeitlin Date: Wed, 1 Jul 2009 09:02:06 +0000 (+0000) Subject: ensure that we have event loop before showing a modal dialog; this allows to do it... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a219792590b1817eb03dd27ca99b12d42c321465?ds=inline ensure that we have event loop before showing a modal dialog; this allows to do it even before the main application loop starts git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/carbon/dialog.cpp b/src/osx/carbon/dialog.cpp index 8855697d64..16a77b7ce2 100644 --- a/src/osx/carbon/dialog.cpp +++ b/src/osx/carbon/dialog.cpp @@ -47,17 +47,10 @@ 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 )