From kde-core-devel Tue Feb 19 13:36:00 2008 From: Thiago Macieira Date: Tue, 19 Feb 2008 13:36:00 +0000 To: kde-core-devel Subject: Re: KMaiL: Can't setup D-Bus service. Probably already running. Message-Id: <200802191436.00342.thiago () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=120342819601351 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart2514777.sDrGGWcpPq" --nextPart2514777.sDrGGWcpPq Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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.= =20 Otherwise it doesn't: you can't ref-count a remote object path. It's=20 impossible to know when it is no longer available unless the service it's o= n=20 goes away. =46or KDE non-unique app service names (org.kde.appname-$PID), I see no nee= d for=20 ever de-registering. For unique app service names (org.kde.kded, for=20 example), I also see no need for unregistering: it's present for the entire= =20 lifetime of the process. =46or services that we may claim or release, then we should also register a= nd=20 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 ? =46rom the message you linked to: "If your app is exiting, just exit, dbus_shutdown() is pointless." I say the same about service names. =2D-=20 =A0 Thiago Macieira =A0- =A0thiago (AT) macieira.info - thiago (AT) kde.org =A0 =A0 PGP/GPG: 0x6EF45358; fingerprint: =A0 =A0 E067 918B B660 DBD1 105C =A0966C 33F5 F005 6EF4 5358 --nextPart2514777.sDrGGWcpPq Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iD8DBQBHuttAM/XwBW70U1gRAsb5AJ9/mPM6MGlbJYwBNN6X+6hYS2yWCwCgojg0 Gp0roSF89wyqxPLP1Dv1VyM= =QfSC -----END PGP SIGNATURE----- --nextPart2514777.sDrGGWcpPq--