[gnome-photos/wip/rishi/online-miners: 2/17] dlna-renderers-dialog: Don't leak the GdkPixbuf




commit 2fe8481f1ef735a4c3bdb8612f0418a871ea634a
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Apr 8 00:08:04 2021 +0200

    dlna-renderers-dialog: Don't leak the GdkPixbuf
    
    https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/215

 src/photos-dlna-renderers-dialog.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/photos-dlna-renderers-dialog.c b/src/photos-dlna-renderers-dialog.c
index ffec403a..dc7a4596 100644
--- a/src/photos-dlna-renderers-dialog.c
+++ b/src/photos-dlna-renderers-dialog.c
@@ -128,7 +128,7 @@ photos_dlna_renderers_dialog_set_icon_cb (GObject      *source_object,
                                           GAsyncResult *res,
                                           gpointer      user_data)
 {
-  GdkPixbuf *pixbuf;
+  GdkPixbuf *pixbuf = NULL;
   GtkImage *image = GTK_IMAGE (user_data);
   PhotosDlnaRenderer *renderer = PHOTOS_DLNA_RENDERER (source_object);
   GError *error = NULL;
@@ -144,6 +144,8 @@ photos_dlna_renderers_dialog_set_icon_cb (GObject      *source_object,
   gtk_image_set_from_pixbuf (image, pixbuf);
 
 out:
+  g_clear_object (&pixbuf);
+
   /* release the ref we took before the async call */
   g_object_unref (image);
 }


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