From 82bfd7cc1cc8f00cd86c87a6132678145bfa0776 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Wed, 10 Dec 2003 15:44:24 +0000 Subject: remove the client from the list if there are errors, instead of re-adding 2003-12-10 Rodrigo Moya * gui/gnome-cal.c (gnome_calendar_add_event_uri): remove the client from the list if there are errors, instead of re-adding it again. Also, unref the ECal object on errors, for not leaking. svn path=/trunk/; revision=23909 --- calendar/ChangeLog | 6 ++++++ calendar/gui/gnome-cal.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 094d6f2003..316567d8e6 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,9 @@ +2003-12-10 Rodrigo Moya + + * gui/gnome-cal.c (gnome_calendar_add_event_uri): remove the client + from the list if there are errors, instead of re-adding it again. + Also, unref the ECal object on errors, for not leaking. + 2003-12-10 Bolian Yin *gui/e-week-view.c: Fix a event/jump button tabbing bug diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 8978f38988..773c367a94 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2173,9 +2173,11 @@ gnome_calendar_add_event_uri (GnomeCalendar *gcal, const char *str_uri) /* FIXME Do this async? */ if (!e_cal_open (client, FALSE, NULL)) { g_hash_table_remove (priv->clients, str_uri); - priv->clients_list = g_list_prepend (priv->clients_list, client); + priv->clients_list = g_list_remove (priv->clients_list, client); g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, gcal); + 0, 0, NULL, NULL, gcal); + + g_object_unref (client); return FALSE; } -- cgit v1.2.3