X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c0e8b4ea5699207befbf692301e12b24bd3409c..67e49a98bbba6793cf1e344477bee9e46d4d5c71:/src/msw/evtloop.cpp diff --git a/src/msw/evtloop.cpp b/src/msw/evtloop.cpp index 8c9f562a33..dca66aba58 100644 --- a/src/msw/evtloop.cpp +++ b/src/msw/evtloop.cpp @@ -146,6 +146,8 @@ bool wxEventLoopImpl::SendIdleMessage() // wxEventLoop implementation // ============================================================================ +wxEventLoop *wxEventLoop::ms_activeLoop = NULL; + // ---------------------------------------------------------------------------- // wxEventLoop running and exiting // ---------------------------------------------------------------------------- @@ -166,6 +168,9 @@ int wxEventLoop::Run() wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); m_impl = new wxEventLoopImpl; + + wxEventLoop *oldLoop = ms_activeLoop; + ms_activeLoop = this; for ( ;; ) { @@ -191,6 +196,8 @@ int wxEventLoop::Run() delete m_impl; m_impl = NULL; + ms_activeLoop = oldLoop; + return exitcode; }