gconf-editor r1448 - in trunk: . src



Author: cosimoc
Date: Tue Nov 18 01:15:37 2008
New Revision: 1448
URL: http://svn.gnome.org/viewvc/gconf-editor?rev=1448&view=rev

Log:
2008-11-18  Cosimo Cecchi  <cosimoc gnome org>

	* src/gconf-bookmarks-dialog.c:
	(gconf_bookmarks_dialog_populate_model):
	* src/gconf-bookmarks.c: (gconf_bookmarks_update_menu):
	* src/gconf-editor-window.c: (gconf_add_recent_key),
	(strip_whitespace):
	* src/gconf-key-editor.c: (gconf_key_editor_init):
	* src/gconf-list-model.c: (gconf_list_model_set_root_path),
	(gconf_list_model_finalize):
	* src/gconf-tree-model.c: (gconf_tree_model_iter_has_child):
	* src/gconf-util.c: (gconf_client_get_schema_for_key):
	Fix a bunch of memory leaks.


Modified:
   trunk/ChangeLog
   trunk/src/gconf-bookmarks-dialog.c
   trunk/src/gconf-bookmarks.c
   trunk/src/gconf-editor-window.c
   trunk/src/gconf-key-editor.c
   trunk/src/gconf-list-model.c
   trunk/src/gconf-tree-model.c
   trunk/src/gconf-util.c

Modified: trunk/src/gconf-bookmarks-dialog.c
==============================================================================
--- trunk/src/gconf-bookmarks-dialog.c	(original)
+++ trunk/src/gconf-bookmarks-dialog.c	Tue Nov 18 01:15:37 2008
@@ -89,7 +89,12 @@
 		gtk_list_store_set (dialog->list_store, &iter,
 				    0, p->data,
 				    -1);
+		g_free (p->data);
 	}
+
+	if (value_list)
+		g_slist_free (value_list);
+
 	dialog->changing_model = FALSE;
 
 	g_object_unref (client);

Modified: trunk/src/gconf-bookmarks.c
==============================================================================
--- trunk/src/gconf-bookmarks.c	(original)
+++ trunk/src/gconf-bookmarks.c	Tue Nov 18 01:15:37 2008
@@ -116,9 +116,12 @@
 													 GTK_ICON_SIZE_MENU));
 		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 		gtk_widget_show_all (menuitem);
+
+		g_free (tmp->data);
 	}
 
 	g_object_unref (client);
+	g_slist_free (list);
 }
 
 static void

Modified: trunk/src/gconf-editor-window.c
==============================================================================
--- trunk/src/gconf-editor-window.c	(original)
+++ trunk/src/gconf-editor-window.c	Tue Nov 18 01:15:37 2008
@@ -245,6 +245,7 @@
 		/* Keep list on a fixed size, remove the last */
 		if (g_slist_length (list) > RECENT_LIST_MAX_SIZE - 1) {
 			tmp = g_slist_last (list);
+			g_free (tmp->data);
 			list = g_slist_delete_link (list, tmp);
 		}
 
@@ -1098,7 +1099,7 @@
 		p = g_utf8_next_char (p);
 	}
 
-	return str->str;
+	return g_string_free (str, FALSE);
 }
 
 static void

Modified: trunk/src/gconf-key-editor.c
==============================================================================
--- trunk/src/gconf-key-editor.c	(original)
+++ trunk/src/gconf-key-editor.c	Tue Nov 18 01:15:37 2008
@@ -590,6 +590,8 @@
 	gtk_widget_show_all (hbox);
 	gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
 
+	g_object_unref (size_group);
+
 	framebox = gtk_vbox_new (FALSE, 6);
 	gtk_widget_show (framebox);
 	gtk_box_pack_start (GTK_BOX (vbox), framebox, FALSE, FALSE, 0);
@@ -682,7 +684,6 @@
 
         /* EDIT_LIST */
 	editor->list_box = gtk_hbox_new (FALSE, 0);
-	hbox = gtk_hbox_new (FALSE, 12);
 	label = gtk_label_new ("    ");
 	gtk_widget_show (label);
 	gtk_box_pack_start (GTK_BOX (editor->list_box), label, FALSE, FALSE, 0);

Modified: trunk/src/gconf-list-model.c
==============================================================================
--- trunk/src/gconf-list-model.c	(original)
+++ trunk/src/gconf-list-model.c	Tue Nov 18 01:15:37 2008
@@ -181,8 +181,12 @@
 
 		path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
 		gtk_tree_model_row_inserted (GTK_TREE_MODEL (model), path, &iter);
+
 		gtk_tree_path_free (path);
 	}
+
+	if (values) 
+		g_slist_free (values);
 }
 
 static GtkTreeModelFlags 
@@ -386,8 +390,14 @@
                 g_object_unref (list_model->client);
         }
 
+	if (list_model->values) {
+		g_slist_foreach (list_model->values, (GFunc) gconf_entry_free, NULL);
+		g_slist_free (list_model->values);
+		list_model->values = NULL;
+	}
+
 	g_free (list_model->root_path);
-	
+
 	G_OBJECT_CLASS (gconf_list_model_parent_class)->finalize (object);
 }
 

Modified: trunk/src/gconf-tree-model.c
==============================================================================
--- trunk/src/gconf-tree-model.c	(original)
+++ trunk/src/gconf-tree-model.c	Tue Nov 18 01:15:37 2008
@@ -421,9 +421,12 @@
 
 	if (list == NULL)
 		return FALSE;
-	else
-		return TRUE;
+	else {
+		g_slist_foreach (list, (GFunc) g_free, NULL);
+		g_slist_free (list);
 
+		return TRUE;
+	}
 }
 
 static void

Modified: trunk/src/gconf-util.c
==============================================================================
--- trunk/src/gconf-util.c	(original)
+++ trunk/src/gconf-util.c	Tue Nov 18 01:15:37 2008
@@ -82,16 +82,20 @@
 {
 	GConfEntry *entry;
 	const char *schema_name;
-	GConfSchema *schema;
+	GConfSchema *schema = NULL;
 
 	entry = gconf_client_get_entry (client, key, NULL, TRUE, NULL);
 	schema_name = gconf_entry_get_schema_name (entry);
 
 	if (schema_name == NULL)
-		return NULL;
+		goto out;
 
 	schema = gconf_client_get_schema (client, schema_name, NULL);
 
+out:
+	if (entry)
+		gconf_entry_free (entry);
+
 	return schema;
 }
 



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