dbus_shutdown call
Ge@@ru
geaaru at gmail.com
Wed Jan 9 04:33:34 PST 2008
Thanks at all for your replies.
Simon McVittie: in my application i use only libdbus (through easydbus)
but i haven't other library that use it on my process, my problem is
handled still with simple example presented here. Probably, as said
Peter Clifton is for a bug in DBus.
Ge@@ru
On Wed, 2008-01-09 at 12:24 +0000, Simon McVittie wrote:
> On Wed, 09 Jan 2008 at 09:47:51 +0100, Ge@@ru wrote:
> > In this case on my application i do:
> > - dbus_bus_get (system bus)
> > - dbus_bus_request_name;
> > - ... do method call
> > - dbus_connection_unref()
> > - dbus_shutdown
> > - exit
> >
> > On session bus this works fine, on system bus
> > before exit an abort is handled for:
> > dbus_shutdown() called but connections were still live. This probably
> > means the application did not drop all its references to bus
> > connections.
> >
> > So, i can't shutdown on system bus.
>
> You're probably linked against a library that also uses the system bus.
> In general you can't do that with shared connections, because you don't
> know who else will be using them.
>
> Don't call dbus_shutdown unless you know that your code is the only user
> of libdbus in the process. You'll get a few "memory leaks" showing up in
> valgrind; work out which ones are libdbus internals (thread locks and
> things like that) and ignore them.
>
> The documentation of dbus_shutdown also suggests that it can be useful
> if an application dlopens libdbus, but I don't think its semantics are
> very useful in that case, since code that's dlopened can't (in general)
> know whether someone else has *also* dlopened libdbus. I think the only
> solution for the dlopen case would be some sort of dbus_library_ref and
> dbus_library_unref semantics (just like the way dlopen and dlclose are
> defined in terms of refcounting, in fact...)
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
More information about the dbus
mailing list