[gnome-control-center] background: Fix memory leak in the picture sources



commit 3942035180e9b0853c0517c050975f109ff96f83
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 2 13:35:21 2013 +0200

    background: Fix memory leak in the picture sources
    
    The list store was taking a reference to the background item,
    so we need to unref it on our side to avoid leaking it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709243

 panels/background/bg-colors-source.c   |    1 +
 panels/background/bg-flickr-source.c   |    1 +
 panels/background/bg-pictures-source.c |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/panels/background/bg-colors-source.c b/panels/background/bg-colors-source.c
index e80c3a6..baa5a8b 100644
--- a/panels/background/bg-colors-source.c
+++ b/panels/background/bg-colors-source.c
@@ -105,6 +105,7 @@ bg_colors_source_init (BgColorsSource *self)
                                          -1);
 
       g_object_unref (pixbuf);
+      g_object_unref (item);
     }
 
   g_object_unref (thumb_factory);
diff --git a/panels/background/bg-flickr-source.c b/panels/background/bg-flickr-source.c
index 75ad255..b294129 100644
--- a/panels/background/bg-flickr-source.c
+++ b/panels/background/bg-flickr-source.c
@@ -102,6 +102,7 @@ _view_items_added_cb (SwClientItemView *item_view,
                                          1, item,
                                          -1);
       g_object_unref (pixbuf);
+      g_object_unref (item);
     }
 }
 
diff --git a/panels/background/bg-pictures-source.c b/panels/background/bg-pictures-source.c
index 86414f1..7283239 100644
--- a/panels/background/bg-pictures-source.c
+++ b/panels/background/bg-pictures-source.c
@@ -188,6 +188,7 @@ picture_scaled (GObject *source_object,
 
 
   g_object_unref (pixbuf);
+  g_object_unref (item);
 }
 
 static void


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