From 4ff0a43cd48adc7cdc98be078cdfbc425aa7e8b0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 14 Nov 2002 23:26:55 +0000 Subject: Use g_object_weak_ref rather than connecting to destroy. 2002-11-14 Jeffrey Stedfast * mail-accounts.c (account_edit_clicked): Use g_object_weak_ref rather than connecting to destroy. (account_add_clicked): Same. * mail-callbacks.c (addrbook_sender): Make this use g_object_weak_notify also. (subscribe_dialog_destroy): Add NULL guards here since I think we really do want to connect to the "destroy" signal in the function that connects us to that signal. * mail-config-factory.c (config_control_factory_cb): Same. * mail-display.c (save_part): Here too. (make_popup_window): And here. * mail-send-recv.c (build_dialogue): Same here. * mail-summary.c (create_summary_view): Use g_object_weak_notify instead of connecting to the destroy signal. svn path=/trunk/; revision=18764 --- mail/mail-send-recv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mail/mail-send-recv.c') diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 95e609e825..3d049dd9c8 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -206,7 +206,7 @@ static void hide_send_info(void *key, struct _send_info *info, void *data) } static void -dialog_destroy (struct _send_data *data, GtkProgressBar *bar) +dialog_destroy_cb (struct _send_data *data, GObject *deadbeef) { g_hash_table_foreach (data->active, (GHFunc) hide_send_info, NULL); data->gd = NULL; @@ -432,8 +432,9 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination) gtk_widget_show (GTK_WIDGET (gd)); - g_signal_connect(gd, "response", G_CALLBACK(dialogue_response), data); - g_signal_connect(gd, "destroy", G_CALLBACK(dialog_destroy), data); + g_signal_connect (gd, "response", G_CALLBACK (dialogue_response), data); + + g_object_weak_notify ((GObject *) gd, (GWeakNotify) dialog_destroy_cb, data); data->infos = list; data->gd = gd; -- cgit