[glib] GIcon: NULLify the `type' out param in the sync methods too



commit 3382ac99be3141e084fea888c428f5d5bf725ab7
Author: Emanuele Aina <emanuele aina collabora com>
Date:   Mon May 20 15:53:40 2013 +0100

    GIcon: NULLify the `type' out param in the sync methods too
    
    Both g_[file|bytes]_icon_load() leave the `type' out parameter
    untouched, while the async methods g_[file|bytes]_icon_load_finish()
    always set it to NULL.
    
    For consistency's sake NULLify it in the sync methods too.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700725

 gio/gbytesicon.c |    3 +++
 gio/gfileicon.c  |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gio/gbytesicon.c b/gio/gbytesicon.c
index dea13cc..801d93a 100644
--- a/gio/gbytesicon.c
+++ b/gio/gbytesicon.c
@@ -223,6 +223,9 @@ g_bytes_icon_load (GLoadableIcon  *icon,
 {
   GBytesIcon *bytes_icon = G_BYTES_ICON (icon);
 
+  if (type)
+    *type = NULL;
+
   return g_memory_input_stream_new_from_bytes (bytes_icon->bytes);
 }
 
diff --git a/gio/gfileicon.c b/gio/gfileicon.c
index 232392f..0778107 100644
--- a/gio/gfileicon.c
+++ b/gio/gfileicon.c
@@ -288,6 +288,9 @@ g_file_icon_load (GLoadableIcon  *icon,
   stream = g_file_read (file_icon->file,
                        cancellable,
                        error);
+
+  if (stream && type)
+    *type = NULL;
   
   return G_INPUT_STREAM (stream);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]