[gnome-software/gnome-3-18] Use g_set_object() to fix a critical warning in gs_app_set_pixbuf()



commit eba94bcfc34ba5ae9eb0ab46906c9395e45a194d
Author: Richard Hughes <richard hughsie com>
Date:   Tue Sep 29 14:44:58 2015 +0100

    Use g_set_object() to fix a critical warning in gs_app_set_pixbuf()

 src/gs-app.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 1eccc46..4c60582 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -934,11 +934,7 @@ void
 gs_app_set_icon (GsApp *app, AsIcon *icon)
 {
        g_return_if_fail (GS_IS_APP (app));
-
-       /* save icon */
-       g_clear_object (&app->icon);
-       if (icon != NULL)
-               app->icon = g_object_ref (icon);
+       g_set_object (&app->icon, icon);
 }
 
 /**
@@ -1002,10 +998,7 @@ void
 gs_app_set_pixbuf (GsApp *app, GdkPixbuf *pixbuf)
 {
        g_return_if_fail (GS_IS_APP (app));
-       g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
-       if (app->pixbuf != NULL)
-               g_object_unref (app->pixbuf);
-       app->pixbuf = g_object_ref (pixbuf);
+       g_set_object (&app->pixbuf, pixbuf);
 }
 
 /**


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