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

Mikel Astiz mikel.astiz.oss at gmail.com
Fri Oct 19 01:11:29 PDT 2012


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.
---
 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;
     }
 
-- 
1.7.11.7



More information about the pulseaudio-discuss mailing list