GNU bug report logs - #9581
24.0.50; dbus-unregister-object fails if service is nil

Previous Next

Package: emacs;

Reported by: Julien Danjou <julien <at> danjou.info>

Date: Thu, 22 Sep 2011 23:02:01 UTC

Severity: normal

Found in version 24.0.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 9581 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Julien Danjou <julien <at> danjou.info>
Cc: 9581 <at> debbugs.gnu.org
Subject: Re: bug#9581: 24.0.50; dbus-unregister-object fails if service is nil
Date: Fri, 23 Sep 2011 17:37:31 +0200
Julien Danjou <julien <at> danjou.info> writes:

> When using `dbus-register-signal', this happens:
> 1. the dbus_bus_add_match() function is called to add a match on the bus
> 2. the (match callback) pair is recorded into
>    `dbus-registered-objets-table' 
>
> This makes things work. When a signal happens, something is looking into
> `dbus-registered-objets-table' and call the callback function.
>
> But to stop listening for a signal, the function to use is
> `dbus-unregister-object', and it is doing this:
> 1. remove the (match callback) pair from `dbus-registered-objets-table'
> 2. call ReleaseName on the service we were listening
>
> While I agree on point 1., the point 2. is totally irrelevant in such a
> case. There's no need to do such a thing, the name has never been
> requested with RequestName before.

It's simply an error. We are speaking abut the generalized
`dbus-unregister-object', which is used for both signals and
methods. ReleaseName shall be called only in case a *method* has been
registered; I'll fix this.

> I think that:
> - step 2 should be removed or another function should be created which
>   does not send a ReleaseName

Nope. See above.

> - dbus_bus_remove_match() should be used to remove the watch from the
>   bus, which would be a lot cleaner.

Good point. Registering a signal shall also keep the match string in
dbus-registered-objects-table (it doesn't yet). Then we could use this
string to send RemoveMatch.

I'll prepare a patch for this (hopefully in time before starting the
pretest).

Best regards, Michael.




This bug report was last modified 13 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.