X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb537cfb1cc0066c0d53a2415972afa6e303c4b5..137c8bde085d6d5b7c459902d2ea1a198ab48765:/src/cocoa/evtloop.mm diff --git a/src/cocoa/evtloop.mm b/src/cocoa/evtloop.mm index c6ab3ea5c6..add5528e94 100644 --- a/src/cocoa/evtloop.mm +++ b/src/cocoa/evtloop.mm @@ -6,7 +6,7 @@ // Created: 2003/10/02 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// License: wxWindows licence +// License: wxWidgets licence /////////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -48,25 +48,17 @@ private: // wxEventLoop running and exiting // ---------------------------------------------------------------------------- -wxEventLoop *wxEventLoop::ms_activeLoop = NULL; - wxEventLoop::~wxEventLoop() { wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") ); } -bool wxEventLoop::IsRunning() const -{ - return m_impl; -} - 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") ); - wxEventLoop *oldLoop = ms_activeLoop; - ms_activeLoop = this; + wxEventLoopActivator activate(this); m_impl = new wxEventLoopImpl; @@ -76,8 +68,6 @@ int wxEventLoop::Run() delete m_impl; m_impl = NULL; - ms_activeLoop = oldLoop; - return exitcode; } @@ -88,7 +78,7 @@ void wxEventLoop::Exit(int rc) m_impl->SetExitCode(rc); NSApplication *cocoaApp = [NSApplication sharedApplication]; - wxLogDebug("wxEventLoop::Exit isRunning=%d", (int)[cocoaApp isRunning]); + wxLogTrace(wxTRACE_COCOA,wxT("wxEventLoop::Exit isRunning=%d"), (int)[cocoaApp isRunning]); wxTheApp->WakeUpIdle(); /* Notes: If we're being called from idle time (which occurs while checking the