[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Re: using dbus in the platform
From:       Thiago Macieira <thiago () kde ! org>
Date:       2007-10-09 18:01:17
Message-ID: 200710092001.17854.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


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

["signature.asc" (application/pgp-signature)]

_______________________________________________
dbus mailing list
dbus@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dbus


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic