[pulseaudio-discuss] [PATCH v2 9/9] bluetooth: Do not release transport if removed

Tanu Kaskinen tanuk at iki.fi
Fri Oct 19 08:53:57 PDT 2012


On Fri, 2012-10-19 at 10:11 +0200, Mikel Astiz wrote:
> From: Mikel Astiz <mikel.astiz at bmw-carit.de>
> 
> If stop_thread() was called because the transport being used has been
> removed, it doesn't make sense to release it, since the D-Bus object
> does not exist any more.

Does it do some harm if it's released anyway? Basing decisions on
whether some hook is firing seems very hacky to me. Especially since
bt_transport_release() is teardown code, it should be safe to call it at
any time, IMO.

-- 
Tanu

> ---
>  src/modules/bluetooth/module-bluetooth-device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
> index 4bf5f03..199a7c8 100644
> --- a/src/modules/bluetooth/module-bluetooth-device.c
> +++ b/src/modules/bluetooth/module-bluetooth-device.c
> @@ -2074,7 +2074,9 @@ static void stop_thread(struct userdata *u) {
>      }
>  
>      if (u->transport) {
> -        bt_transport_release(u);
> +        if (!pa_hook_is_firing(&u->transport->hooks[PA_BLUETOOTH_TRANSPORT_HOOK_REMOVED]))
> +            bt_transport_release(u);
> +
>          u->transport = NULL;
>      }
>  




More information about the pulseaudio-discuss mailing list