dbus_g_connection_close() ?

Mark McLoughlin mark at skynet.ie
Tue Sep 6 09:58:23 PDT 2005


Hey,
	Since you currently have to close a connection before unrefing it for
the last time, it seems like dbus_g_connection_close() would be a
sensible addition to the glib bindings?

	Patch below, okay to commit?

Thanks,
Mark.

Index: dbus/dbus-glib.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-glib.h,v
retrieving revision 1.20
diff -u -p -r1.20 dbus-glib.h
--- dbus/dbus-glib.h	11 Jul 2005 16:12:50 -0000	1.20
+++ dbus/dbus-glib.h	6 Sep 2005 16:43:35 -0000
@@ -54,6 +54,7 @@ DBusGMessage*     dbus_g_message_ref    
 void              dbus_g_message_unref           (DBusGMessage           *message);
 
 void              dbus_g_connection_flush        (DBusGConnection        *connection);
+void              dbus_g_connection_close        (DBusGConnection        *connection);
 
 GQuark dbus_g_error_quark (void);
 #define DBUS_GERROR dbus_g_error_quark ()
Index: glib/dbus-glib.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-glib.c,v
retrieving revision 1.9
diff -u -p -r1.9 dbus-glib.c
--- glib/dbus-glib.c	31 Jul 2005 02:09:15 -0000	1.9
+++ glib/dbus-glib.c	6 Sep 2005 16:43:35 -0000
@@ -50,6 +50,17 @@ dbus_g_connection_flush (DBusGConnection
 }
 
 /**
+ * Closes the connection, so no further data can be sent or received.
+ * 
+ * @param connection the connection to close
+ */
+void
+dbus_g_connection_close (DBusGConnection *connection)
+{
+  dbus_connection_close (DBUS_CONNECTION_FROM_G_CONNECTION (connection));
+}
+
+/**
  * Increment refcount on a #DBusGConnection
  * 
  * @param gconnection the connection to ref






More information about the dbus mailing list