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:
parent
d43f911108
commit
024008efc7
|
@ -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>
|
Thu Feb 15 02:29:01 PST 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
* libnotify/notify.c:
|
* libnotify/notify.c:
|
||||||
|
|
|
@ -675,9 +675,10 @@ _close_signal_handler(DBusGProxy *proxy, guint32 id,
|
||||||
{
|
{
|
||||||
if (id == notification->priv->id)
|
if (id == notification->priv->id)
|
||||||
{
|
{
|
||||||
|
g_object_ref(G_OBJECT(notification));
|
||||||
g_signal_emit(notification, signals[SIGNAL_CLOSED], 0);
|
g_signal_emit(notification, signals[SIGNAL_CLOSED], 0);
|
||||||
|
|
||||||
notification->priv->id = 0;
|
notification->priv->id = 0;
|
||||||
|
g_object_unref(G_OBJECT(notification));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue