[evolution] Bug 652634 - Runtime warning on second search dialog



commit d24bf99f46989bba098e3f4a19c3d0c7f706bb8a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Jul 10 19:05:41 2011 -0400

    Bug 652634 - Runtime warning on second search dialog
    
    A signal handler connected to an EFilterRule was passing a GtkDialog
    instance as the closure.  Eventually, the GtkDialog is destroyed but
    we never disconnected the signal handler.

 shell/e-shell-content.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c
index 8868163..a109ffb 100644
--- a/shell/e-shell-content.c
+++ b/shell/e-shell-content.c
@@ -641,6 +641,7 @@ e_shell_content_run_advanced_search_dialog (EShellContent *shell_content)
 	EFilterRule *rule;
 	ERuleContext *context;
 	const gchar *user_filename;
+	gulong handler_id;
 	gint response;
 	EAlert *alert = NULL;
 
@@ -675,7 +676,7 @@ e_shell_content_run_advanced_search_dialog (EShellContent *shell_content)
 	content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
 	gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0);
 
-	g_signal_connect_swapped (
+	handler_id = g_signal_connect_swapped (
 		rule, "changed", G_CALLBACK (
 		shell_content_dialog_rule_changed), dialog);
 
@@ -704,6 +705,8 @@ run:
 	}
 
 exit:
+	g_signal_handler_disconnect (rule, handler_id);
+
 	g_object_unref (rule);
 	gtk_widget_destroy (dialog);
 }
@@ -744,6 +747,7 @@ e_shell_content_run_save_search_dialog (EShellContent *shell_content)
 	ERuleContext *context;
 	const gchar *user_filename;
 	gchar *search_name;
+	gulong handler_id;
 	gint response;
 	EAlert *alert = NULL;
 
@@ -778,7 +782,7 @@ e_shell_content_run_save_search_dialog (EShellContent *shell_content)
 	content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
 	gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0);
 
-	g_signal_connect_swapped (
+	handler_id = g_signal_connect_swapped (
 		rule, "changed", G_CALLBACK (
 		shell_content_dialog_rule_changed), dialog);
 
@@ -804,6 +808,8 @@ run:
 	e_rule_context_save (context, user_filename);
 
 exit:
+	g_signal_handler_disconnect (rule, handler_id);
+
 	g_object_unref (rule);
 	gtk_widget_destroy (dialog);
 }



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