[anjuta] file-manager: Fix leak of GtkTreeModelSort.



commit 6342920006c3dadc3c7429c904e86df23eab0491
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Mon Jan 21 21:19:27 2013 +0100

    file-manager: Fix leak of GtkTreeModelSort.
    
    GtkTreeModelSort is not descendant of GInitiallyUnowned so we
    need to release the reference we got when the sort_model was
    created.

 plugins/file-manager/file-view.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/plugins/file-manager/file-view.c b/plugins/file-manager/file-view.c
index c3550f3..77d4ce2 100644
--- a/plugins/file-manager/file-view.c
+++ b/plugins/file-manager/file-view.c
@@ -784,6 +784,9 @@ file_view_init (AnjutaFileView *object)
 	sort_model = gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(priv->model));
 	
 	gtk_tree_view_set_model (GTK_TREE_VIEW(object), sort_model);
+	/* set_model takes a reference so we can release the reference we got when
+	 * the sort_model was created. */
+	g_object_unref (sort_model);
 	gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE(sort_model),
 											 file_view_sort_model,
 											 NULL,



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