From 408ed636718294b0c0676bc6bdb690811c4793ac Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 25 Feb 2009 10:52:45 +0000 Subject: ** Fix for bug #559719 2009-02-25 Milan Crha ** Fix for bug #559719 * google-contacts-source.c: (struct ui_data), (destroy_ui_data), (plugin_google_contacts): * plugins/google-account-setup/plugins/webdav-account-setup/webdav-contacts-source.c: (destroy_ui_data), (plugin_webdav_contacts): Use it's own/unique name for the property on the 'epl' and free the widget only if it wasn't freed yet. svn path=/trunk/; revision=37325 --- plugins/webdav-account-setup/ChangeLog | 8 ++++++++ plugins/webdav-account-setup/webdav-contacts-source.c | 17 +++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'plugins/webdav-account-setup') diff --git a/plugins/webdav-account-setup/ChangeLog b/plugins/webdav-account-setup/ChangeLog index 29e3e82796..512d6a1318 100644 --- a/plugins/webdav-account-setup/ChangeLog +++ b/plugins/webdav-account-setup/ChangeLog @@ -1,3 +1,11 @@ +2009-02-25 Milan Crha + + ** Part of fix for bug #559719 + + * webdav-contacts-source.c: (destroy_ui_data), + (plugin_webdav_contacts): Use it's own/unique name for the property + on the 'epl' and free the widget only if it wasn't freed yet. + 2009-01-29 Milan Crha ** Fix for bug #539467 diff --git a/plugins/webdav-account-setup/webdav-contacts-source.c b/plugins/webdav-account-setup/webdav-contacts-source.c index 2242b9050d..8edfa59372 100644 --- a/plugins/webdav-account-setup/webdav-contacts-source.c +++ b/plugins/webdav-account-setup/webdav-contacts-source.c @@ -272,12 +272,14 @@ on_toggle_changed(GtkToggleButton *tb, gpointer user_data) } static void -destroy_ui_data(gpointer data) +destroy_ui_data (gpointer data) { - ui_data *ui_data = data; + ui_data *ui = data; - gtk_widget_destroy(ui_data->box); - g_free(ui_data); + if (ui && ui->box) + gtk_widget_destroy (ui->box); + + g_free (ui); } GtkWidget * @@ -304,8 +306,7 @@ plugin_webdav_contacts(EPlugin *epl, EConfigHookItemFactoryData *data) base_uri = e_source_group_peek_base_uri (group); - g_object_set_data_full (G_OBJECT (epl), "widget", NULL, - (GDestroyNotify)gtk_widget_destroy); + g_object_set_data (G_OBJECT (epl), "wwidget", NULL); if (strcmp(base_uri, BASE_URI) != 0) { return NULL; @@ -369,8 +370,8 @@ plugin_webdav_contacts(EPlugin *epl, EConfigHookItemFactoryData *data) gtk_widget_show_all(vbox2); uidata->box = vbox2; - g_object_set_data_full(G_OBJECT(epl), "widget", uidata, - destroy_ui_data); + g_object_set_data_full(G_OBJECT(epl), "wwidget", uidata, destroy_ui_data); + g_signal_connect (uidata->box, "destroy", G_CALLBACK (gtk_widget_destroyed), &uidata->box); g_signal_connect(G_OBJECT(uidata->username_entry), "changed", G_CALLBACK(on_entry_changed), uidata); -- cgit v1.2.3