aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify/alarm-notify.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-12-17 19:59:47 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-12-17 19:59:47 +0800
commit350bdccc968a80bc7819d1bc7c302584c165b771 (patch)
tree1c67ad334ef3909fc3d62030f0fa6d3825277f1b /calendar/gui/alarm-notify/alarm-notify.c
parentef5c4898659a7811fb442b5cf7b85ec346332381 (diff)
downloadgsoc2013-evolution-350bdccc968a80bc7819d1bc7c302584c165b771.tar.gz
gsoc2013-evolution-350bdccc968a80bc7819d1bc7c302584c165b771.tar.zst
gsoc2013-evolution-350bdccc968a80bc7819d1bc7c302584c165b771.zip
make sure we free the data stored in the hash table.
2003-12-17 Rodrigo Moya <rodrigo@ximian.com> * gui/alarm-notify/alarm-notify.c (alarm_notify_remove_calendar): make sure we free the data stored in the hash table. (alarm_notify_add_calendar): call alarm_queue_add_client, or we wont have alarms at all. * gui/alarm-notify/alarm-queue.c: no need to hold a ref count. (alarm_queue_add_client, alarm_queue_remove_client): don't use the refcount private member. (alarm_queue_add_client): don't connect to non-existing ECal signals. (display_notification, free_client_alarms_cb): fixed warnings. svn path=/trunk/; revision=23960
Diffstat (limited to 'calendar/gui/alarm-notify/alarm-notify.c')
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
index 9e7f1335a8..37addc4d9a 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/gui/alarm-notify/alarm-notify.c
@@ -179,6 +179,7 @@ alarm_notify_add_calendar (AlarmNotify *an, const char *str_uri, gboolean load_a
if (e_cal_open (client, FALSE, NULL)) {
g_hash_table_insert (priv->uri_client_hash,
g_strdup (str_uri), client);
+ alarm_queue_add_client (client);
}
}
}
@@ -188,13 +189,15 @@ alarm_notify_remove_calendar (AlarmNotify *an, const char *str_uri)
{
AlarmNotifyPrivate *priv;
ECal *client;
+ gpointer orig_key, orig_value;
priv = an->priv;
- client = g_hash_table_lookup (priv->uri_client_hash, str_uri);
- if (client) {
+ if (g_hash_table_lookup_extended (priv->uri_client_hash, str_uri, &orig_key, &orig_value)) {
alarm_queue_remove_client (client);
g_hash_table_remove (priv->uri_client_hash, str_uri);
+ g_free (orig_key);
+ g_object_unref (orig_value);
}
}