[gtk+] [filechooser] Don't add extra ref to file, as it it comes from gtk_tree_model_get()



commit 2aad7a515119548f4cbf8c43afeeb0c18db4d17b
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Apr 1 12:44:10 2011 -0600

    [filechooser] Don't add extra ref to file, as it it comes from gtk_tree_model_get()
    
    Leak kindly reported by leak finder extraordinaire Morten Welinder <mortenw gnome org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=646457

 gtk/gtkfilechooserdefault.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 9c6c717..849bd73 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -8732,7 +8732,7 @@ search_selected_foreach_get_file_cb (GtkTreeModel *model,
   list = data;
 
   gtk_tree_model_get (model, iter, MODEL_COL_FILE, &file, -1);
-  *list = g_slist_prepend (*list, g_object_ref (file));
+  *list = g_slist_prepend (*list, file); /* The file already has a new ref courtesy of gtk_tree_model_get(); this will be unreffed by the caller */
 }
 
 /* Constructs a list of the selected paths in search mode */



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