[Galago-commits] r2968 - in trunk/libnotify: . libnotify

galago-commits at freedesktop.org galago-commits at freedesktop.org
Thu Feb 15 02:45:41 PST 2007


Author: chipx86
Date: 2007-02-15 02:45:40 -0800 (Thu, 15 Feb 2007)
New Revision: 2968

Modified:
   trunk/libnotify/ChangeLog
   trunk/libnotify/libnotify/notification.c
Log:
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.


Modified: trunk/libnotify/ChangeLog
===================================================================
--- trunk/libnotify/ChangeLog	2007-02-15 10:29:16 UTC (rev 2967)
+++ trunk/libnotify/ChangeLog	2007-02-15 10:45:40 UTC (rev 2968)
@@ -1,3 +1,12 @@
+Thu Feb 15 02:44:16 PST 2007  Christian Hammond <chipx86 at 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 at chipx86.com>
 
 	* libnotify/notify.c:

Modified: trunk/libnotify/libnotify/notification.c
===================================================================
--- trunk/libnotify/libnotify/notification.c	2007-02-15 10:29:16 UTC (rev 2967)
+++ trunk/libnotify/libnotify/notification.c	2007-02-15 10:45:40 UTC (rev 2968)
@@ -675,9 +675,10 @@
 {
 	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));
 	}
 }
 



More information about the galago-commits mailing list