From cda5c26a4842a74636022aad5493c080f96d6ae5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 3 Jul 2013 00:29:29 +0000 Subject: [PATCH] Add wxStreamTempInputBuffer::ReadAll() helper. This just reads everything remaining in the stream in a blocking way and will be used to get the data remaining in the stream buffers after the child process had been already closed (and hence can't write any more to it and there is no risk of deadlock). See #10258. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/private/streamtempinput.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/wx/private/streamtempinput.h b/include/wx/private/streamtempinput.h index 72f3957ec3..cf56481677 100644 --- a/include/wx/private/streamtempinput.h +++ b/include/wx/private/streamtempinput.h @@ -91,6 +91,19 @@ public: return !m_stream || m_stream->Eof(); } + // read everything remaining until the EOF, this should only be called once + // the child process terminates and we know that no more data is coming + bool ReadAll() + { + while ( !Eof() ) + { + if ( !Update() ) + return false; + } + + return true; + } + // dtor puts the data buffered during this object lifetime into the // associated stream ~wxStreamTempInputBuffer() -- 2.45.2