From 43b8448af85c3d7c3bf2a779c07ff3bcb2069e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 23 Mar 2013 18:12:36 +0000 Subject: [PATCH] [INTERPRETER] * BUG: Don't flush the process output at process end if the process stream has already been closed. git-svn-id: svn://localhost/gambas/trunk@5585 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_c_process.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/main/gbx/gbx_c_process.c b/main/gbx/gbx_c_process.c index e6fe9cb0a..35abb6234 100644 --- a/main/gbx/gbx_c_process.c +++ b/main/gbx/gbx_c_process.c @@ -280,15 +280,18 @@ static void stop_process_after(CPROCESS *_object) if (THIS->out >= 0) { stream = CSTREAM_stream(THIS); - while (!STREAM_eof(stream)) + if (!STREAM_is_closed(stream)) { - STREAM_lof(stream, &len); - callback_write(THIS->out, 0, THIS); - if (STREAM_is_closed(stream)) - break; - STREAM_lof(stream, &len2); - if (len == len2) - break; + while (!STREAM_eof(stream)) + { + STREAM_lof(stream, &len); + callback_write(THIS->out, 0, THIS); + if (STREAM_is_closed(stream)) + break; + STREAM_lof(stream, &len2); + if (len == len2) + break; + } } }