summaryrefslogtreecommitdiff
path: root/android/sco.c
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2014-12-03 11:42:24 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-12-03 14:23:34 +0100
commit08b4eb63871e0908ce34b44e97c4ffffb9edd861 (patch)
treede362bd25eeb6432d6f6e5a1a7ae0cc9214a02fc /android/sco.c
parent6dfd0d376ff222eb7da283ece7f88a1cc6f4a0c0 (diff)
downloadbluez-08b4eb63871e0908ce34b44e97c4ffffb9edd861.tar.gz
android/sco: Fix for disconnect SCO
We should just shutdown io and wait for disconnect callback in disconnect function, otherwise we might get some races e.g. when doing connect/disconnect SCO. This patch fix that.
Diffstat (limited to 'android/sco.c')
-rw-r--r--android/sco.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/android/sco.c b/android/sco.c
index 7dd7013b7..e8ac6854f 100644
--- a/android/sco.c
+++ b/android/sco.c
@@ -310,18 +310,8 @@ void bt_sco_disconnect(struct bt_sco *sco)
if (!sco)
return;
- if (sco->watch) {
- g_source_remove(sco->watch);
- sco->watch = 0;
- }
-
- if (sco->io) {
+ if (sco->io)
g_io_channel_shutdown(sco->io, TRUE, NULL);
- g_io_channel_unref(sco->io);
- sco->io = NULL;
- }
-
- clear_remote_address(sco);
}
bool bt_sco_get_fd_and_mtu(struct bt_sco *sco, int *fd, uint16_t *mtu)