SetFocus() ;
WindowRef windowRef = (WindowRef) GetWXWindow();
- WindowGroupRef windowGroup;
- WindowGroupRef formerParentGroup;
+ WindowGroupRef windowGroup = NULL;
+ WindowGroupRef formerParentGroup = NULL;
bool resetGroupParent = false;
if ( GetParent() == NULL )
}
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
+}