Only call flush if non-null.
authorAlexander Larsson <alexl@redhat.com>
Tue, 4 Dec 2007 10:44:49 +0000 (10:44 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Tue, 4 Dec 2007 10:44:49 +0000 (10:44 +0000)
2007-12-04  Alexander Larsson  <alexl@redhat.com>

        * goutputstream.c:
        (g_output_stream_close):
Only call flush if non-null.

svn path=/trunk/; revision=6040

gio/ChangeLog
gio/goutputstream.c

index 62e85b7..b9000fc 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-04  Alexander Larsson  <alexl@redhat.com>
+
+        * goutputstream.c:
+        (g_output_stream_close):
+       Only call flush if non-null.
+
 2007-11-30  Dan Winship  <danw@gnome.org>
 
        * ginputstream.c (g_input_stream_set_pending): Make this take a
index 458c33e..62c75a6 100644 (file)
@@ -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)
     {