Short lived, or "private", objects on the bus
ross at burtonini.com
Fri May 18 05:11:39 PDT 2007
On Fri, 2007-05-18 at 10:28 +0100, jamie wrote:
> I would say the only issue is how do you automatically dispose of it if
> the app that created the object disconnects from the bus?
> (we could store the app pid that created it and listen for disconnects
> but Im not sure how this is all supposed to work and even if the
> disconnect signal gives us the pid?)
This is trivial, you know the address of the connection which caused the
object to exist, so have a hash of bus addresses to list of objects.
Then listen for NameOwnerChanged signals where the old name is the name
you are looking for and the new name is "", look up that name in the
hash, and destroy all of the objects.
Ross Burton mail: ross at burtonini.com
jabber: ross at burtonini.com
PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF
More information about the dbus