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-config-factory.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'mail/mail-config-factory.c') diff --git a/mail/mail-config-factory.c b/mail/mail-config-factory.c index fe1aa9cb2e..4e7e0ee2ed 100644 --- a/mail/mail-config-factory.c +++ b/mail/mail-config-factory.c @@ -48,16 +48,14 @@ struct _config_data { }; static void -config_control_destroy_callback (EvolutionConfigControl *config_control, void *user_data) +config_control_destroy_cb (struct _config_data *data, GObject *deadbeef) { - struct _config_data *data = user_data; - g_object_unref (data->prefs); g_free (data); } static void -config_control_apply_callback (EvolutionConfigControl *config_control, void *user_data) +config_control_apply_cb (EvolutionConfigControl *config_control, void *user_data) { struct _config_data *data = user_data; @@ -116,8 +114,8 @@ config_control_factory_cb (BonoboGenericFactory *factory, const char *component_ g_assert_not_reached (); } - g_signal_connect(control, "apply", G_CALLBACK (config_control_apply_callback), data); - g_signal_connect(control, "destroy", G_CALLBACK (config_control_destroy_callback), data); + g_signal_connect (control, "apply", G_CALLBACK (config_control_apply_cb), data); + g_object_weak_ref (control, (GWeakNotify) config_control_destroy_cb, data); return BONOBO_OBJECT (control); } -- cgit v1.2.3