From 896a99db9d7eba1d98c521d2aef4f0a960930abc Mon Sep 17 00:00:00 2001 From: Christian Hammond Date: Wed, 30 Jun 2004 09:53:58 +0000 Subject: [PATCH] Free up the handle memory for a closed notification. --- ChangeLog | 5 +++++ libnotify/notify.c | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3b3899d..1ac83ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jun 30 02:53:36 PDT 2004 Christian Hammond + + * libnotify/notify.c: + - Free up the handle memory for a closed notification. + Tue Jun 29 19:33:43 PDT 2004 Christian Hammond * libnotify/notify.c: diff --git a/libnotify/notify.c b/libnotify/notify.c index 15df38d..332da38 100644 --- a/libnotify/notify.c +++ b/libnotify/notify.c @@ -202,7 +202,16 @@ _filter_func(DBusConnection *dbus_conn, DBusMessage *message, void *user_data) if (dbus_message_is_signal(message, NOTIFY_DBUS_CORE_INTERFACE, "NotificationClosed")) { - /* We can ignore this, pretty much. */ + guint32 id; + NotifyHandle *handle; + + dbus_message_iter_init(message, &iter); + id = dbus_message_iter_get_uint32(&iter); + + handle = g_hash_table_lookup(_handles, GINT_TO_POINTER(id)); + + if (handle != NULL && handle->type == NOTIFY_TYPE_NOTIFICATION) + g_hash_table_remove(_handles, GINT_TO_POINTER(id)); } else if (dbus_message_is_signal(message, NOTIFY_DBUS_CORE_INTERFACE, "RequestClosed"))