[gnome-software/wip/temp/ubuntu-xenial-rebased: 70/326] Fix GdkPixbufLoader usage



commit eac38b1afab1a9eba02ff8fbe1a284e4ba45107d
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Feb 2 21:01:33 2016 +1300

    Fix GdkPixbufLoader usage

 src/plugins/gs-plugin-snappy.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-snappy.c b/src/plugins/gs-plugin-snappy.c
index d6f649d..2c6e8a4 100644
--- a/src/plugins/gs-plugin-snappy.c
+++ b/src/plugins/gs-plugin-snappy.c
@@ -323,7 +323,8 @@ get_apps (GsPlugin *plugin, GList **list, AppFilterFunc filter_func, gpointer us
 
                                loader = gdk_pixbuf_loader_new ();
                                gdk_pixbuf_loader_write (loader, (guchar *) icon_response, 
icon_response_length, NULL);
-                               icon_pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+                               gdk_pixbuf_loader_close (loader, NULL);
+                               icon_pixbuf = g_object_ref (gdk_pixbuf_loader_get_pixbuf (loader));
                        }
                        else
                                g_printerr ("Failed to get icon\n");
@@ -340,7 +341,8 @@ get_apps (GsPlugin *plugin, GList **list, AppFilterFunc filter_func, gpointer us
                        soup_session_send_message (session, message);
                        loader = gdk_pixbuf_loader_new ();
                        gdk_pixbuf_loader_write (loader, (guint8 *) message->response_body->data,  
message->response_body->length, NULL);
-                       icon_pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+                       gdk_pixbuf_loader_close (loader, NULL);
+                       icon_pixbuf = g_object_ref (gdk_pixbuf_loader_get_pixbuf (loader));
                }
 
                if (icon_pixbuf)


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