[goffice] GUI: Plug leaks.



commit b502b36ac2bbceaebd47d9b86079c95f66be4c77
Author: Morten Welinder <terra gnome org>
Date:   Fri Feb 18 16:44:31 2011 -0500

    GUI: Plug leaks.

 ChangeLog                   |    6 ++++++
 NEWS                        |    3 +++
 goffice/gtk/go-font-sel.c   |    1 +
 goffice/gtk/go-format-sel.c |    6 +++++-
 goffice/gtk/go-image-sel.c  |    1 +
 5 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b7dfd3e..87d1b41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-18  Morten Welinder  <terra gnome org>
+
+	* goffice/gtk/go-format-sel.c (nfs_init): Plug leaks.
+	* goffice/gtk/go-font-sel.c (list_init): Ditto.
+	* goffice/gtk/go-image-sel.c (go_image_sel_new): Ditto.
+
 2011-02-02  Morten Welinder <terra gnome org>
 
 	* configure.in: Post-release bump.
diff --git a/NEWS b/NEWS
index a3c3aa6..7b74b86 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.8.14:
 
+Morten:
+	* Plug leaks.
+
 --------------------------------------------------------------------------
 goffice 0.8.13:
 
diff --git a/goffice/gtk/go-font-sel.c b/goffice/gtk/go-font-sel.c
index ddb92b1..6595b46 100644
--- a/goffice/gtk/go-font-sel.c
+++ b/goffice/gtk/go-font-sel.c
@@ -122,6 +122,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);
diff --git a/goffice/gtk/go-format-sel.c b/goffice/gtk/go-format-sel.c
index 4ddba23..fd7c510 100644
--- a/goffice/gtk/go-format-sel.c
+++ b/goffice/gtk/go-format-sel.c
@@ -885,6 +885,7 @@ populate_menu (GOFormatSel *gfs)
 						 (1, G_TYPE_STRING));
 	gtk_tree_view_set_model (GTK_TREE_VIEW (gfs->format.menu),
 				 gfs->format.menu_model);
+	g_object_unref (gfs->format.menu_model);
 	selection = gtk_tree_view_get_selection
 		(GTK_TREE_VIEW(gfs->format.menu));
 	gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
@@ -1045,6 +1046,8 @@ nfs_init (GOFormatSel *gfs)
 	gfs->format.negative_types.view = GTK_TREE_VIEW (gfs->format.widget[F_NEGATIVE]);
 	gtk_tree_view_set_model (gfs->format.negative_types.view,
 				 GTK_TREE_MODEL (gfs->format.negative_types.model));
+	g_object_unref (gfs->format.negative_types.model);
+
 	column = gtk_tree_view_column_new_with_attributes
 		(_("Negative Number Format"),
 		 gtk_cell_renderer_text_new (),
@@ -1073,7 +1076,8 @@ nfs_init (GOFormatSel *gfs)
 	gfs->format.formats.model = gtk_list_store_new (1, G_TYPE_STRING);
 	gfs->format.formats.view = GTK_TREE_VIEW (gfs->format.widget[F_LIST]);
 	gtk_tree_view_set_model (gfs->format.formats.view,
-		GTK_TREE_MODEL (gfs->format.formats.model));
+				 GTK_TREE_MODEL (gfs->format.formats.model));
+	g_object_unref (gfs->format.formats.model);
 	column = gtk_tree_view_column_new_with_attributes (_("Number Formats"),
 		gtk_cell_renderer_text_new (),
 		"text",		0,
diff --git a/goffice/gtk/go-image-sel.c b/goffice/gtk/go-image-sel.c
index 4527f18..ebb8db8 100644
--- a/goffice/gtk/go-image-sel.c
+++ b/goffice/gtk/go-image-sel.c
@@ -221,6 +221,7 @@ go_image_sel_new (GODoc *doc, GOCmdContext *cc, GOImage **image)
 	state->icon_view = GTK_ICON_VIEW (gtk_builder_get_object (state->gui, "image-iconview"));
 	state->model = gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
 	gtk_icon_view_set_model (state->icon_view , GTK_TREE_MODEL (state->model));
+	g_object_unref (state->model);
 
 	/* Set sort column and function */
 	gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (state->model),



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