From 74e95b90d288ba2a5f513b508615869b98c80a66 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 4 Dec 2007 10:44:49 +0000 Subject: [PATCH] Only call flush if non-null. 2007-12-04 Alexander Larsson * goutputstream.c: (g_output_stream_close): Only call flush if non-null. svn path=/trunk/; revision=6040 --- gio/ChangeLog | 6 ++++++ gio/goutputstream.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 62e85b7..b9000fc 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,9 @@ +2007-12-04 Alexander Larsson + + * goutputstream.c: + (g_output_stream_close): + Only call flush if non-null. + 2007-11-30 Dan Winship * ginputstream.c (g_input_stream_set_pending): Make this take a diff --git a/gio/goutputstream.c b/gio/goutputstream.c index 458c33e..62c75a6 100644 --- a/gio/goutputstream.c +++ b/gio/goutputstream.c @@ -518,7 +518,10 @@ g_output_stream_close (GOutputStream *stream, if (cancellable) g_push_current_cancellable (cancellable); - res = class->flush (stream, cancellable, error); + if (class->flush) + res = class->flush (stream, cancellable, error); + else + res = TRUE; if (!res) { -- 2.7.4