Prevent a crash when the handler for a notification's closed signal removes the last reference to the notification. We attempted to set the ID of the notification after emitting this signal, but the notification was destroyed already. So, keep a reference while doing all this. This fixes bug #116.

This commit is contained in:
Christian Hammond 2007-02-15 10:45:40 +00:00
parent d43f911108
commit 024008efc7
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,12 @@
Thu Feb 15 02:44:16 PST 2007 Christian Hammond <chipx86@chipx86.com>
* libnotify/notification.c:
- Prevent a crash when the handler for a notification's closed signal
removes the last reference to the notification. We attempted to set
the ID of the notification after emitting this signal, but the
notification was destroyed already. So, keep a reference while doing
all this. This fixes bug #116.
Thu Feb 15 02:29:01 PST 2007 Christian Hammond <chipx86@chipx86.com>
* libnotify/notify.c:

View File

@ -675,9 +675,10 @@ _close_signal_handler(DBusGProxy *proxy, guint32 id,
{
if (id == notification->priv->id)
{
g_object_ref(G_OBJECT(notification));
g_signal_emit(notification, signals[SIGNAL_CLOSED], 0);
notification->priv->id = 0;
g_object_unref(G_OBJECT(notification));
}
}