X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f38f68999028a8ff8d3cd0b1cf4a0fc94af805b0..4115960d4b88375610bd0a8990a5a522c9fbe003:/src/msw/utilsexc.cpp diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 5ba14aad62..4eed50125a 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -385,7 +381,7 @@ bool wxPipeInputStream::CanRead() const wxLogLastError(_T("PeekNamedPipe")); } - // don't try to continue reading from a pipe if an error occured or if + // don't try to continue reading from a pipe if an error occurred or if // it had been closed ::CloseHandle(m_hInput); @@ -417,7 +413,7 @@ size_t wxPipeInputStream::OnSysRead(void *buffer, size_t len) : wxSTREAM_READ_ERROR; } - // bytesRead is set to 0, as desired, if an error occured + // bytesRead is set to 0, as desired, if an error occurred return bytesRead; } @@ -531,7 +527,7 @@ static bool wxExecuteDDE(const wxString& ddeServer, long wxExecute(const wxString& cmd, int flags, wxProcess *handler) { - wxCHECK_MSG( !cmd.IsEmpty(), 0, wxT("empty command in wxExecute") ); + wxCHECK_MSG( !cmd.empty(), 0, wxT("empty command in wxExecute") ); #if wxUSE_THREADS // for many reasons, the code below breaks down if it's called from another @@ -888,14 +884,12 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) return pi.dwProcessId; } - wxAppTraits *traits = NULL; - void *cookie wxDUMMY_INITIALIZE(NULL); + wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; + wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") ); + + void *cookie = NULL; if ( !(flags & wxEXEC_NODISABLE) ) { - if ( wxTheApp ) - traits = wxTheApp->GetTraits(); - wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") ); - // disable all app windows while waiting for the child process to finish cookie = traits->BeforeChildWaitLoop(); } @@ -916,8 +910,11 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) traits->AlwaysYield(); } - if ( traits ) + if ( !(flags & wxEXEC_NODISABLE) ) + { + // reenable disabled windows back traits->AfterChildWaitLoop(cookie); + } DWORD dwExitCode = data->dwExitCode; delete data;