[pulseaudio-discuss] [PATCHv2 23/60] bluetooth: Track org.bluez for BlueZ 5

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Fri Aug 16 07:13:16 PDT 2013


On Tue, 2013-08-13 at 01:54 -0300, jprvita at gmail.com wrote:
> From: João Paulo Rechi Vita <jprvita at openbossa.org>
> 
> ---
>  src/modules/bluetooth/bluez5-util.c | 94 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 94 insertions(+)
> 
> diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
> index 0f23bff..d60f63c 100644
> --- a/src/modules/bluetooth/bluez5-util.c
> +++ b/src/modules/bluetooth/bluez5-util.c
> @@ -69,6 +151,18 @@ void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *y) {
>      if (PA_REFCNT_DEC(y) > 0)
>          return;
>  
> +    if (y->connection) {
> +        pa_dbus_remove_matches(pa_dbus_connection_get(y->connection),
> +            "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged'"
> +            ",arg0='" BLUEZ_SERVICE "'",
> +            NULL);

The match rules should only be removed if they have been added, so you
need to keep track of that. There can be multiple instances of the same
match rule, so if bluez5-util removes a match rule that it hasn't added,
it may remove someone else's match rule (a real example is bluez4-util,
because it tracks org.bluez name owner too).

-- 
Tanu



More information about the pulseaudio-discuss mailing list