fix a hang up in wxExecute(wxArrayString& output) overload (#4380)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-06-30 23:37:56 +00:00
parent e974c5d258
commit 386a2898e3

View File

@ -433,8 +433,19 @@ wxPipeInputStream::~wxPipeInputStream()
bool wxPipeInputStream::CanRead() const
{
// we can read if there's something in the put back buffer
// even pipe is closed
if ( m_wbacksize > m_wbackcur )
return true;
wxPipeInputStream * const self = wxConstCast(this, wxPipeInputStream);
if ( !IsOpened() )
{
// set back to mark Eof as it may have been unset by Ungetch()
self->m_lasterror = wxSTREAM_EOF;
return false;
}
DWORD nAvailable;
@ -460,8 +471,6 @@ bool wxPipeInputStream::CanRead() const
// it had been closed
::CloseHandle(m_hInput);
wxPipeInputStream *self = wxConstCast(this, wxPipeInputStream);
self->m_hInput = INVALID_HANDLE_VALUE;
self->m_lasterror = wxSTREAM_EOF;