KMaiL: Can't setup D-Bus service. Probably already running.

Thiago Macieira thiago at kde.org
Tue Feb 19 13:36:00 GMT 2008


On Tuesday 19 February 2008 14:16:44 Ralf Habacker wrote:
> I agree as a last chance, but the dbus people suggests to unregister
> services and/or pathes when they are no more needed and not to relay on
> the tcp or unix socket connection close behavior.
>
> If the connection is finalized (refcount reaches 0) your object path
> is automatically unregistered. However, typically it's better to
> unregister an object path at the point where you don't want it invoked
> anymore; after all, someone else may be holding a refcount, and you
> don't want the object path registration to accidentally stay alive,
> especially if you freed the object it refers to.

If you s/object path/service name/ in the paragraph above, it makes sense. 
Otherwise it doesn't: you can't ref-count a remote object path. It's 
impossible to know when it is no longer available unless the service it's on 
goes away.

For KDE non-unique app service names (org.kde.appname-$PID), I see no need for 
ever de-registering. For unique app service names (org.kde.kded, for 
example), I also see no need for unregistering: it's present for the entire 
lifetime of the process.

For services that we may claim or release, then we should also register and 
de-register at the proper times.

> http://lists.freedesktop.org/archives/dbus/2008-February/009328.html
>
> This supports to unregister in the destructor of the last
> KUniqueApplication or KApplication object (may be in a static class
> method) because registering was done in the creating of the first
> KAppplication or KuniqueApplication or are I'm completly wrong ?

From the message you linked to:
"If your app is exiting, just exit, dbus_shutdown() is pointless."

I say the same about service names.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080219/38473a78/attachment.sig>


More information about the kde-core-devel mailing list