[gnome-builder] subprocess: ensure we have a closed stream
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] subprocess: ensure we have a closed stream
- Date: Wed, 14 Sep 2016 08:23:44 +0000 (UTC)
commit e3792fc030dab286481a3d3bffd388d536a0ba58
Author: Christian Hergert <chergert redhat com>
Date: Wed Sep 14 00:55:45 2016 -0700
subprocess: ensure we have a closed stream
Not sure how we are hitting this case, but we should be able to protect
against it.
libide/subprocess/ide-breakout-subprocess.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/libide/subprocess/ide-breakout-subprocess.c b/libide/subprocess/ide-breakout-subprocess.c
index 6432c4e..20f8370 100644
--- a/libide/subprocess/ide-breakout-subprocess.c
+++ b/libide/subprocess/ide-breakout-subprocess.c
@@ -313,6 +313,8 @@ communicate_result_validate_utf8 (const char *stream_name,
if (buffer)
{
const char *end;
+ if (!g_output_stream_is_closed (G_OUTPUT_STREAM (buffer)))
+ g_output_stream_close (G_OUTPUT_STREAM (buffer), NULL, NULL);
*return_location = g_memory_output_stream_steal_data (buffer);
if (!g_utf8_validate (*return_location, -1, &end))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]