[anjuta] starter: Fix leak of GtkRecentInfo.



commit 11c1ee2ad3833f9a8ce76f5d15917a53646c64f9
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Wed Jan 9 15:27:15 2013 +0100

    starter: Fix leak of GtkRecentInfo.

 plugins/starter/plugin.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/plugins/starter/plugin.c b/plugins/starter/plugin.c
index c2d5f7e..40aed20 100644
--- a/plugins/starter/plugin.c
+++ b/plugins/starter/plugin.c
@@ -99,15 +99,15 @@ static void
 build_recent_projects (GtkWidget *box, StarterPlugin* plugin)
 {
 	GtkRecentManager *manager;
-	GList *list;
+	GList *items, *list;
 	gint i = 0;
 	
 	manager = gtk_recent_manager_get_default ();
 
-	list = gtk_recent_manager_get_items (manager);
-	
-	list = g_list_reverse (list);
+	items = gtk_recent_manager_get_items (manager);
+	items = g_list_reverse (items);
 
+	list = items;
 	while (i < RECENT_LIMIT && list != NULL)
 	{
 		if (strcmp (gtk_recent_info_get_mime_type (list->data), "application/x-anjuta") == 0)
@@ -178,8 +178,7 @@ build_recent_projects (GtkWidget *box, StarterPlugin* plugin)
 		list = g_list_next (list);
 	}
 
-	g_list_foreach (list, (GFunc)gtk_recent_info_unref, NULL);
-	g_list_free (list);
+	g_list_free_full(items, (GDestroyNotify)gtk_recent_info_unref);
 }
 
 static GtkWidget*



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