[gnumeric] GUI: plug leaks.



commit 82d7404eede31dcfe43e9f92a36e3cb586c232ad
Author: Morten Welinder <terra gnome org>
Date:   Fri Feb 18 16:43:23 2011 -0500

    GUI: plug leaks.

 src/dialogs/ChangeLog              |    4 ++
 src/dialogs/dialog-cell-format.c   |   54 ++++++++++++++++++++----------------
 src/widgets/ChangeLog              |    4 ++
 src/widgets/widget-font-selector.c |    1 +
 4 files changed, 39 insertions(+), 24 deletions(-)
---
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index ef92063..f1b551a 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,9 @@
 2011-02-18  Morten Welinder  <terra gnome org>
 
+	* dialog-cell-format.c (build_validation_error_combo): Don't leak
+	a ref to "store".
+	(fmt_dialog_init_conditions_page): Plug leak.
+
 	* dialog-solver.c (fill_algorithm_combo): Don't leak a ref to
 	"store".
 	(dialog_init): Ditto.
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index 79dea34..9aeee16 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -1772,48 +1772,52 @@ build_validation_error_combo (GtkComboBox *box)
 
 	gtk_list_store_append (store, &iter);
 	gtk_list_store_set (store, &iter,
-				1, _("None          (silently accept invalid input)"),
-				-1);
+			    1, _("None          (silently accept invalid input)"),
+			    -1);
 
 	pixbuf = gtk_widget_render_icon (GTK_WIDGET (box), GTK_STOCK_STOP,
-										 GTK_ICON_SIZE_BUTTON, NULL);
+					 GTK_ICON_SIZE_BUTTON, NULL);
 	gtk_list_store_append (store, &iter);
 	gtk_list_store_set (store, &iter,
-				0, pixbuf,
-				1, _("Stop            (never allow invalid input)"),
-				-1);
+			    0, pixbuf,
+			    1, _("Stop            (never allow invalid input)"),
+			    -1);
 
-	pixbuf = gtk_widget_render_icon (GTK_WIDGET (box), GTK_STOCK_DIALOG_WARNING,
-										 GTK_ICON_SIZE_BUTTON, NULL);
+	pixbuf = gtk_widget_render_icon (GTK_WIDGET (box),
+					 GTK_STOCK_DIALOG_WARNING,
+					 GTK_ICON_SIZE_BUTTON, NULL);
 	gtk_list_store_append (store, &iter);
 	gtk_list_store_set (store, &iter,
-				0, pixbuf,
-				1, _("Warning     (accept/discard invalid input)"),
-				-1);
+			    0, pixbuf,
+			    1, _("Warning     (accept/discard invalid input)"),
+			    -1);
 
-	pixbuf = gtk_widget_render_icon (GTK_WIDGET (box), GTK_STOCK_DIALOG_INFO,
-										 GTK_ICON_SIZE_BUTTON, NULL);
+	pixbuf = gtk_widget_render_icon (GTK_WIDGET (box),
+					 GTK_STOCK_DIALOG_INFO,
+					 GTK_ICON_SIZE_BUTTON, NULL);
 	gtk_list_store_append (store, &iter);
 	gtk_list_store_set (store, &iter,
-				0, pixbuf,
-				1, _("Information (allow invalid input)"),
-				-1);
+			    0, pixbuf,
+			    1, _("Information (allow invalid input)"),
+			    -1);
 
 	renderer = gtk_cell_renderer_pixbuf_new ();
 	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (box),
-								renderer,
-								FALSE);
+				    renderer,
+				    FALSE);
 	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (box), renderer,
-									"pixbuf", 0,
-									NULL);
+					"pixbuf", 0,
+					NULL);
 
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (box),
-								renderer,
-								TRUE);
+				    renderer,
+				    TRUE);
 	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (box), renderer,
-									"text", 1,
-									NULL);
+					"text", 1,
+					NULL);
+
+	g_object_unref (store);
 }
 
 static void
@@ -2212,6 +2216,8 @@ fmt_dialog_init_conditions_page (FormatState *state)
 	treeview = GTK_TREE_VIEW (go_gtk_builder_get_widget (state->gui, "conditions_treeview"));
 	gtk_tree_view_set_fixed_height_mode (treeview, FALSE);
 	gtk_tree_view_set_model (treeview, GTK_TREE_MODEL (state->conditions.model));
+	g_object_unref (state->conditions.model);
+
 	renderer = gtk_cell_renderer_text_new ();
 	column = gtk_tree_view_column_new_with_attributes
 		("Range", renderer, "text", CONDITIONS_RANGE, NULL);
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index c5ed319..a2cefff 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-18  Morten Welinder  <terra gnome org>
+
+	* widget-font-selector.c (list_init): Plug leak.
+
 2011-02-13  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* gnumeric-expr-entry.c (gee_set_tooltip): add Ctrl-F4 info
diff --git a/src/widgets/widget-font-selector.c b/src/widgets/widget-font-selector.c
index 27921b5..4c00f60 100644
--- a/src/widgets/widget-font-selector.c
+++ b/src/widgets/widget-font-selector.c
@@ -141,6 +141,7 @@ list_init (GtkTreeView* view)
 	gtk_tree_view_set_headers_visible (view, FALSE);
 	store = gtk_list_store_new (1, G_TYPE_STRING);
 	gtk_tree_view_set_model (view, GTK_TREE_MODEL (store));
+	g_object_unref (store);
 	renderer = gtk_cell_renderer_text_new ();
 	column = gtk_tree_view_column_new_with_attributes
 		(NULL, renderer, "text", 0, NULL);



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