[goffice] Fix memory leak and criticals in graph editor. [#626665]



commit 29782a3ec1c804984ab16bfd5f5bb7b7fce2407c
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Aug 12 07:59:16 2010 +0200

    Fix memory leak and criticals in graph editor. [#626665]

 ChangeLog                          |    6 ++++++
 NEWS                               |    1 +
 goffice/graph/gog-error-bar.c      |    2 +-
 plugins/plot_distrib/gog-boxplot.c |    3 +--
 4 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d1448f0..d6c4c12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-12  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/graph/gog-error-bar.c (gog_error_bar_prefs): fix memory leak.
+	* plugins/plot_distrib/gog-boxplot.c (gog_box_plot_pref),
+	(gog_box_plot_populate_editor): fix memory leak and criticals. [#626665]
+
 2010-08-11  Jean Brefort  <jean brefort normalesup org>
 
 	* goffice/canvas/goc-graph.c (goc_graph_draw): fix blur in zoomed charts.
diff --git a/NEWS b/NEWS
index 675d4dd..adef122 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ goffice 0.8.9:
 Jean:
 	* Don't crash when loading a corrupted chart. [#626206, #626263, #626305]
 	* Fix blur in zoomed charts.
+	* Fix memory leak and criticals in graph editor. [#626665]
 
 --------------------------------------------------------------------------
 goffice 0.8.8:
diff --git a/goffice/graph/gog-error-bar.c b/goffice/graph/gog-error-bar.c
index 312f28d..4983873 100644
--- a/goffice/graph/gog-error-bar.c
+++ b/goffice/graph/gog-error-bar.c
@@ -335,7 +335,7 @@ gog_error_bar_prefs (GogSeries *series,
 		gtk_widget_hide (go_gtk_builder_get_widget (gui, "values_box"));
 		gtk_widget_hide (go_gtk_builder_get_widget (gui, "style_box"));
 	}
-	g_signal_connect (G_OBJECT (bar_prefs), "destroy", G_CALLBACK (g_object_unref), gui);
+	g_signal_connect_swapped (G_OBJECT (bar_prefs), "destroy", G_CALLBACK (g_object_unref), gui);
 
 	return GTK_WIDGET(bar_prefs);
 }
diff --git a/plugins/plot_distrib/gog-boxplot.c b/plugins/plot_distrib/gog-boxplot.c
index 8ef44b4..8a8788b 100644
--- a/plugins/plot_distrib/gog-boxplot.c
+++ b/plugins/plot_distrib/gog-boxplot.c
@@ -147,7 +147,7 @@ gog_box_plot_pref (GogObject *obj,
 
 	w = go_gtk_builder_get_widget (gui, "gog_box_plot_prefs");
 	g_object_set_data (G_OBJECT (w), "state", gui);
-	g_signal_connect (G_OBJECT (w), "destroy", G_CALLBACK (g_object_unref), gui);
+	g_signal_connect_swapped (G_OBJECT (w), "destroy", G_CALLBACK (g_object_unref), gui);
 
 	return w;
 }
@@ -160,7 +160,6 @@ gog_box_plot_populate_editor (GogObject *item,
 {
 	GtkWidget *w =  gog_box_plot_pref (item, dalloc, cc);
 	go_editor_add_page (editor,w, _("Properties"));
-	g_object_unref (w);
 
 	(GOG_OBJECT_CLASS(gog_box_plot_parent_klass)->populate_editor) (item, editor, dalloc, cc);
 }



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