using DBUS_BUS_STARTER and DBUS_BUS_SESSION in the same process

Havoc Pennington hp at redhat.com
Wed Nov 9 21:11:29 PST 2005


On Thu, 2005-11-10 at 01:04 +0000, Robert McQueen wrote:
> You run into problems if you use DBUS_BUS_STARTER in one place in a
> process, and DBUS_BUS_SESSION later on in the same process. dbus_bus_get
> ends up getting the same DBusConnection instance, but when you call it
> with the different bus type, it tries to dbus_bus_register on the
> already existing bus connection even though it was already registered
> under the other type, with an annoying warning as a consequence. I get
> this in the Python bindings even now I'm caching instances of each bus
> type, and someone on #dbus was running into it working with Evince's
> single instance support. Would it be possible to fix this so that it
> stores the bus under both the starter and the "real" name, and doesn't
> try and double register it?

Should be simple enough, just use the BusData struct in dbus-bus.c to
track whether the connection is already registered ... just add another
flag in there.

Havoc




More information about the dbus mailing list