[evolution-patches] #43506 (Summary)



As far as I can see, this bug happens in the following scenario: you
open a new Evolution window, select the summary in it, close the window,
do something to cause any of the monitored GConf keys to change.

This causes dead summary controls to receive "value_changed"
notifications, and hence crash.

-- Ettore
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/my-evolution/ChangeLog,v
retrieving revision 1.288
diff -u -p -r1.288 ChangeLog
--- ChangeLog	19 May 2003 15:24:01 -0000	1.288
+++ ChangeLog	23 May 2003 21:12:38 -0000
@@ -1,3 +1,14 @@
+2003-05-23  Ettore Perazzoli  <ettore ximian com>
+
+	* e-summary-tasks.c: New member gconf_value_changed_handler_id in
+	ESummaryTasks.
+
+	* e-summary-calendar.c: New member gconf_value_changed_handler_id
+	in ESummaryCalendar.
+	(setup_gconf_client): Set it to the ID of the signal connection.
+
+	* e-summary-tasks.c (generate_html): Remove unused variable.
+
 2003-05-19  Anna Marie Dirks  <anna ximian com>
 
 	* e-summary-preferences.c: This patch HIG-ifies the "New News Feed" 
Index: e-summary-calendar.c
===================================================================
RCS file: /cvs/gnome/evolution/my-evolution/e-summary-calendar.c,v
retrieving revision 1.43
diff -u -p -r1.43 e-summary-calendar.c
--- e-summary-calendar.c	16 May 2003 16:45:10 -0000	1.43
+++ e-summary-calendar.c	23 May 2003 21:12:38 -0000
@@ -51,6 +51,7 @@ struct _ESummaryCalendar {
 	char *default_uri;
 
 	GConfClient *gconf_client;
+	int gconf_value_changed_handler_id;
 
 	int cal_open_reload_timeout_id;
 	int reload_count;
@@ -570,8 +571,9 @@ setup_gconf_client (ESummary *summary)
 
 	calendar->gconf_client = gconf_client_get_default ();
 
-	g_signal_connect (calendar->gconf_client, "value_changed",
-			  G_CALLBACK (gconf_client_value_changed_cb), summary);
+	calendar->gconf_value_changed_handler_id
+		= g_signal_connect (calendar->gconf_client, "value_changed",
+				    G_CALLBACK (gconf_client_value_changed_cb), summary);
 
 	gconf_client_add_dir (calendar->gconf_client, "/apps/evolution/calendar", FALSE, NULL);
 	gconf_client_add_dir (calendar->gconf_client, "/apps/evolution/shell/default_folders", FALSE, NULL);
@@ -619,7 +621,10 @@ e_summary_calendar_free (ESummary *summa
 	g_object_unref (calendar->client);
 	g_free (calendar->html);
 	g_free (calendar->default_uri);
-	
+
+	if (calendar->gconf_value_changed_handler_id != 0)
+		g_signal_handler_disconnect (calendar->gconf_client,
+					     calendar->gconf_value_changed_handler_id);
 	g_object_unref (calendar->gconf_client);
 
 	g_free (calendar);
Index: e-summary-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/my-evolution/e-summary-tasks.c,v
retrieving revision 1.43
diff -u -p -r1.43 e-summary-tasks.c
--- e-summary-tasks.c	27 Mar 2003 21:37:07 -0000	1.43
+++ e-summary-tasks.c	23 May 2003 21:12:38 -0000
@@ -55,6 +55,7 @@ struct _ESummaryTasks {
 	char *default_uri;
 
 	GConfClient *gconf_client;
+	int gconf_value_changed_handler_id;
 
 	int cal_open_reload_timeout_id;
 	int reload_count;
@@ -330,8 +331,6 @@ generate_html (gpointer data)
 					   NULL);
 		return FALSE;
 	} else {
-		char *s;
-
 		uids = cal_list_sort (uids, sort_uids, tasks->client);
 		string = g_string_new (NULL);
 		g_string_sprintf (string, "<dl><dt><img src=\"myevo-post-it.png\" align=\"middle\" "
@@ -533,8 +532,9 @@ setup_gconf_client (ESummary *summary)
 	gconf_client_add_dir (tasks->gconf_client, "/apps/evolution/calendar/tasks/colors", FALSE, NULL);
 	gconf_client_add_dir (tasks->gconf_client, "/apps/evolution/shell/default_folders", FALSE, NULL);
 
-	g_signal_connect (tasks->gconf_client, "value_changed",
-			  G_CALLBACK (gconf_client_value_changed_cb), summary);
+	tasks->gconf_value_changed_handler_id
+		= g_signal_connect (tasks->gconf_client, "value_changed",
+				    G_CALLBACK (gconf_client_value_changed_cb), summary);
 }
 
 void
@@ -580,6 +580,9 @@ e_summary_tasks_free (ESummary *summary)
 	g_free (tasks->overdue_colour);
 	g_free (tasks->default_uri);
 
+	if (tasks->gconf_value_changed_handler_id != 0)
+		g_signal_handler_disconnect (tasks->gconf_client,
+					     tasks->gconf_value_changed_handler_id);
 	g_object_unref (tasks->gconf_client);
 
 	g_free (tasks);


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