X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c3fad64b429a8f88396ad3b1693b611206ee8ee5..460354e939bc52de1b5a749b6d88d6ef21f5827b:/src/msw/utilsexc.cpp diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 226677c279..53c3b2f5f5 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -385,7 +385,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 +417,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; } @@ -888,14 +888,12 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) return pi.dwProcessId; } - wxAppTraits *traits = 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 +914,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;