summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2007-02-15 10:45:40 +0000
committerChristian Hammond <chipx86@chipx86.com>2007-02-15 10:45:40 +0000
commit024008efc7dea7d188a453974fb70f694b1d6bfb (patch)
tree23cce701afe1142095d4abcc6aeea2f377b885bf
parentd43f911108f2e38545d416ff1a0cce686ddabf3c (diff)
downloadlibnotify-024008efc7dea7d188a453974fb70f694b1d6bfb.tar.gz
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.
-rw-r--r--ChangeLog9
-rw-r--r--libnotify/notification.c3
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d7800f3..e6da548 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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:
diff --git a/libnotify/notification.c b/libnotify/notification.c
index aee5979..c9de255 100644
--- a/libnotify/notification.c
+++ b/libnotify/notification.c
@@ -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));
}
}