WX_DEFINE_LIST(wxMsgList)
#endif // wxUSE_THREADS
-// ----------------------------------------------------------------------------
-// helper class
-// ----------------------------------------------------------------------------
-
-// this object sets the wxEventLoop given to the ctor as the currently active
-// one and unsets it in its dtor
-class wxEventLoopActivator
-{
-public:
- wxEventLoopActivator(wxEventLoop **pActive,
- wxEventLoop *evtLoop)
- {
- m_pActive = pActive;
- m_evtLoopOld = *pActive;
- *pActive = evtLoop;
- }
-
- ~wxEventLoopActivator()
- {
- // restore the previously active event loop
- *m_pActive = m_evtLoopOld;
- }
-
-private:
- wxEventLoop *m_evtLoopOld;
- wxEventLoop **m_pActive;
-};
-
// ============================================================================
// wxEventLoop implementation
// ============================================================================
// wxEventLoop running and exiting
// ----------------------------------------------------------------------------
-bool wxEventLoop::IsRunning() const
-{
- return ms_activeLoop == this;
-}
-
int wxEventLoop::Run()
{
// event loops are not recursive, you need to create another loop!
// ProcessIdle() 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);
+ wxEventLoopActivator activate(this);
// 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