From f7d587939d8df919d50fff368ebaffde4276ea25 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 26 Feb 2004 13:48:44 +0000 Subject: make sure we unref the task pad client and the calendar clients are 2004-02-26 JP Rosevear * gui/gnome-cal.c (client_cal_opened_cb): make sure we unref the task pad client and the calendar clients are unreffed by the hash table svn path=/trunk/; revision=24880 --- calendar/ChangeLog | 6 ++++++ calendar/gui/gnome-cal.c | 21 ++++++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 6fb8396b5a..a27e8d31e4 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,9 @@ +2004-02-26 JP Rosevear + + * gui/gnome-cal.c (client_cal_opened_cb): make sure we unref the + task pad client and the calendar clients are unreffed by the hash + table + 2004-02-24 JP Rosevear * gui/migration.c (migrate_calendars): fix float type pane diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 491756bf6b..0ac372548e 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1782,21 +1782,13 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) e_calendar_view_set_status_message (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)), NULL); } } else { - if (ecal == priv->task_pad_client) + if (ecal == priv->task_pad_client) { + g_object_unref (priv->task_pad_client); priv->task_pad_client = NULL; - else { - gpointer orig_uid; - gpointer orig_client; - - if (g_hash_table_lookup_extended (priv->clients, e_cal_get_uri (ecal), &orig_uid, &orig_client)) { - g_hash_table_remove (priv->clients, e_cal_get_uri (ecal)); - g_free (orig_uid); - } - - priv->clients_list = g_list_append (priv->clients_list, ecal); + } else { + priv->clients_list = g_list_remove (priv->clients_list, ecal); + g_hash_table_remove (priv->clients, e_cal_get_uri (ecal)); } - - g_object_unref (ecal); } } @@ -1963,9 +1955,8 @@ backend_died_cb (ECal *client, gpointer data) calendar_component_peek_source_selector (calendar_component_peek ()), e_cal_get_source (client)); - g_hash_table_remove (priv->clients, e_cal_get_uri (client)); priv->clients_list = g_list_remove (priv->clients_list, client); - g_object_unref (client); + g_hash_table_remove (priv->clients, e_cal_get_uri (client)); } dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), -- cgit v1.2.3