[PATCH 1/3] Fixed reference leaks in folder list store



diff --git a/ChangeLog b/ChangeLog
index adf4747..292ef98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
+2008-11-27  Jose Dapena Paz  <jdapena igalia com>
+
+	* libtinymailui-gtk/tny-gtk-folder-list-store.c:
+	Fixed reference leaks
+
 2008-11-24  Jose Dapena Paz  <jdapena igalia com>
 
 	* Added new TnyGtkFolderListStore, implementing a plain model (no tree)
 	for the folder store.
 
diff --git a/libtinymailui-gtk/tny-gtk-folder-list-store.c b/libtinymailui-gtk/tny-gtk-folder-list-store.c
index 7241e89..2181898 100644
--- a/libtinymailui-gtk/tny-gtk-folder-list-store.c
+++ b/libtinymailui-gtk/tny-gtk-folder-list-store.c
@@ -899,19 +899,23 @@ find_parent_helper (GtkTreeModel *model,
 	gtk_tree_model_get (model, iter, 
 			    TNY_GTK_FOLDER_LIST_STORE_INSTANCE_COLUMN, 
 			    &folder_store, -1);
 
 	/* Only search on same account */
-	if (TNY_IS_ACCOUNT (folder_store) && ((TnyAccount *)folder_store == helper_info->account))
+	if (TNY_IS_ACCOUNT (folder_store) && ((TnyAccount *)folder_store == helper_info->account)) {
+		g_object_unref (folder_store);
 		return FALSE;
+	}
 
 	if (TNY_IS_FOLDER (folder_store)) {
 		TnyAccount *account = NULL;
 		account = tny_folder_get_account (TNY_FOLDER (folder_store));
 		g_object_unref (account);
-		if (account == helper_info->account)
+		if (account == helper_info->account) {
+			g_object_unref (folder_store);
 			return FALSE;
+		}
 	}
 
 	children = TNY_LIST (tny_simple_list_new ());
 	tny_folder_store_get_folders (folder_store, children, NULL, FALSE, NULL);
 	iterator = tny_list_create_iterator (children);
@@ -928,10 +932,11 @@ find_parent_helper (GtkTreeModel *model,
 		}
 		tny_iterator_next (iterator);
 	}
 	g_object_unref (iterator);
 	g_object_unref (children);
+	g_object_unref (folder_store);
 
 	return helper_info->found;
 	
 }
 
@@ -977,10 +982,11 @@ find_node_helper (GtkTreeModel *model,
 
 	if ((TnyFolderStore *) helper_info->folder == folder_store) {
 		helper_info->found = TRUE;
 		*helper_info->iter = *iter;
 	}
+	g_object_unref (folder_store);
 
 	return helper_info->found;
 	
 }
 
-- 
1.5.6.3


--=-5u3qG+wGoTeJMBAsEI3T--



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