- wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") );
-}
-
-bool wxEventLoop::IsRunning() const
-{
- return m_impl != NULL;
-}
-
-int wxEventLoop::Run()
-{
- // event loops are not recursive, you need to create another loop!
- wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
-
- // SendIdleMessage() and Dispatch() below may throw so the code here should
- // be exception-safe, hence we must use local objects for all actions we
- // should undo
- wxEventLoopActivator activate(&ms_activeLoop, this);
- wxEventLoopImplTiedPtr impl(&m_impl, new wxEventLoopImpl);
-
- // we must ensure that OnExit() is called even if an exception is thrown
- // from inside Dispatch() but we must call it from Exit() in normal
- // situations because it is supposed to be called synchronously,
- // wxModalEventLoop depends on this (so we can't just use ON_BLOCK_EXIT or
- // something similar here)
- wxTRY
- {
- for ( ;; )
- {