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



commit 6094ea6478444a7b90db1787f8258ce819acebb0
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 7915b7f..c844e09 100644
--- a/panels/background/bg-flickr-source.c
+++ b/panels/background/bg-flickr-source.c
@@ -118,6 +118,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 b678e61..a1af10b 100644
--- a/panels/background/bg-pictures-source.c
+++ b/panels/background/bg-pictures-source.c
@@ -201,6 +201,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]