From f5fec6d07180668bd0f10ff405dbe0e87b224bea Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sun, 9 Sep 2001 23:32:31 +0000 Subject: We need to initialize all of the struct fields or else god knows what will 2001-09-09 Jeffrey Stedfast * mail-config-druid.c (evolution_mail_config_wizard_factory_fn): We need to initialize all of the struct fields or else god knows what will happen later when we try to use 'em. Also set a destroy function for the MailConfigWizard so we don't leak it. svn path=/trunk/; revision=12719 --- mail/ChangeLog | 7 +++++++ mail/mail-config-druid.c | 28 ++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 981c4b260b..8d826c7ef4 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2001-09-09 Jeffrey Stedfast + + * mail-config-druid.c (evolution_mail_config_wizard_factory_fn): + We need to initialize all of the struct fields or else god knows + what will happen later when we try to use 'em. Also set a destroy + function for the MailConfigWizard so we don't leak it. + 2001-09-08 Jon Trowbridge * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Added. diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c index 4fe0a88b21..043964443b 100644 --- a/mail/mail-config-druid.c +++ b/mail/mail-config-druid.c @@ -852,6 +852,18 @@ wizard_help_cb (EvolutionWizard *wizard, { } +static void +wizard_free (MailConfigWizard *wizard) +{ + if (wizard->gui) + mail_account_gui_destroy (wizard->gui); + + if (wizard->account) + account_destroy (wizard->account); + + g_free (wizard); +} + static BonoboObject * evolution_mail_config_wizard_factory_fn (BonoboGenericFactory *factory, void *closure) @@ -861,17 +873,20 @@ evolution_mail_config_wizard_factory_fn (BonoboGenericFactory *factory, MailConfigWizard *gui; account = make_account (); - + gui = g_new (MailConfigWizard, 1); + gui->gui = NULL; gui->account = account; - gui->gui = NULL; - + gui->identity_copied = FALSE; + gui->last_source = NULL; + wizard = evolution_wizard_new (get_fn, 5, gui); account_wizard = wizard; - - gtk_object_set_data (GTK_OBJECT (account_wizard), "account-data", gui); + + gtk_object_set_data_full (GTK_OBJECT (account_wizard), + "account-data", gui, wizard_free); gui->wizard = wizard; - + gtk_signal_connect (GTK_OBJECT (wizard), "next", GTK_SIGNAL_FUNC (wizard_next_cb), gui); gtk_signal_connect (GTK_OBJECT (wizard), "prepare", @@ -884,6 +899,7 @@ evolution_mail_config_wizard_factory_fn (BonoboGenericFactory *factory, GTK_SIGNAL_FUNC (wizard_cancel_cb), gui); gtk_signal_connect (GTK_OBJECT (wizard), "help", GTK_SIGNAL_FUNC (wizard_help_cb), gui); + return BONOBO_OBJECT (wizard); } -- cgit v1.2.3