GDBusConnection: when to close, when to unref

Lars Hanisch dvb at flensrocker.de
Thu Jun 6 22:50:39 PDT 2013


Hi,

 I'm using two different ways to connect to dbus-daemons.

 First I use g_bus_get to connect to the system- resp. session-bus.
 OTOH I use g_dbus_connection_new_for_address to connect to a third dbus-daemon, which is listening on a tcp port.

 I know that sometimes, connections must not be closed, but I must confess, that I've not really understand when and
when not.

 In the first case I assume, that I don't have to use g_dbus_connection_close since that are shared connections, right?
 But do I have to g_object_unref the connection object?

 In the second case, where I create a new connection, do I have to close it? And what about g_object_unref?

 Thanks for clarification!

Lars.


More information about the dbus mailing list