Bonobo Listener patch



Hi, this patch is required for creating a BonoboListener with
bonobo_listener_new (NULL, NULL); without the patch it gives a warning.

May I commit?

iain
-- 
"It isn't rebels who cause the troubles of the world, 
it's the troubles that cause the rebels." - Carl Oglesby
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libbonobo/ChangeLog,v
retrieving revision 1.195
diff -U2 -r1.195 ChangeLog
--- ChangeLog	2001/09/26 07:37:09	1.195
+++ ChangeLog	2001/09/29 06:33:58
@@ -1,2 +1,7 @@
+2001-09-29  Iain Holmes  <iain ximian com>
+
+	* bonobo/bonobo-listener.c (bonobo_listener_new): Check if the callback
+	function is NULL, and if so, don't create a GClosure.
+
 2001-09-27  Michael Meeks  <michael ximian com>
 
Index: bonobo/bonobo-listener.c
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo/bonobo-listener.c,v
retrieving revision 1.26
diff -U2 -r1.26 bonobo-listener.c
--- bonobo/bonobo-listener.c	2001/09/05 11:12:09	1.26
+++ bonobo/bonobo-listener.c	2001/09/29 06:33:58
@@ -181,6 +181,13 @@
 		     gpointer                 user_data)
 {
-	return bonobo_listener_new_closure (
-		g_cclosure_new (G_CALLBACK (event_cb), user_data, NULL));
+	GClosure *closure;
+
+	if (event_cb == NULL) {
+		closure = NULL;
+	} else {
+		closure = g_cclosure_new (G_CALLBACK (event_cb), user_data, NULL);
+	}
+
+	return bonobo_listener_new_closure (closure);
 }
 

Attachment: pgpehh46SCPen.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]