+int wxEventLoopBase::Run()
+{
+ // event loops are not recursive, you need to create another loop!
+ wxCHECK_MSG( !IsInsideRun(), -1, wxT("can't reenter a message loop") );
+
+ // ProcessIdle() and ProcessEvents() 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(this);
+
+ // We might be called again, after a previous call to ScheduleExit(), so
+ // reset this flag.
+ m_shouldExit = false;
+
+ // Set this variable to true for the duration of this method.
+ m_isInsideRun = true;
+ wxON_BLOCK_EXIT_SET(m_isInsideRun, false);
+
+ // Finally really run the loop.
+ return DoRun();
+}
+
+void wxEventLoopBase::Exit(int rc)
+{
+ wxCHECK_RET( IsRunning(), wxS("Use ScheduleExit() on not running loop") );
+
+ ScheduleExit(rc);
+}
+