using dbus in the platform
thiago at kde.org
Tue Oct 9 11:01:17 PDT 2007
Em Tuesday 09 October 2007 19:31:12 Simon McVittie escreveu:
> However, at the moment there are cases (like register_object_path) where
> it's very hard to tell whether you are actually complying with the API
> contract. dbus-python internally keeps track of what object paths are in
> use, just so it can comply with the libdbus API. This leads to a large
> amount of unnecessarily subtle code that I should never have had to
> write - the only reason it works at all is that dbus-python uses a
> private bus connection (a shared bus connection would completely break
> this approach), and I leak a small amount of memory if OOM
> happens at precisely the wrong point, because that's the least bad thing
> I can do.
In this specific case, I'd argue that register_object_path should fail with a
normal error if the object cannot be registered due to it already being
there. There's no need for a try_* function.
By the same logic, the unregister function should not fail if there isn't any
object registered at the path. That way, a user that wants to override a path
can call unregister, then register.
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: not available
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20071009/01e196f1/attachment.pgp
More information about the dbus