summaryrefslogtreecommitdiff
path: root/android/a2dp.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-01-20 14:23:26 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-01-21 13:37:35 +0200
commite2551c5f541e27e7745ac6a6216b437ea8b16186 (patch)
tree9da6b4514d048e308922937818e3e43309dce1db /android/a2dp.c
parent192cadbfeae9398b148309933651f879188ab8a7 (diff)
downloadbluez-e2551c5f541e27e7745ac6a6216b437ea8b16186.tar.gz
android/A2DP: Fix sending notification on bt_a2dp_unregister
At this point IPC might have been closed already.
Diffstat (limited to 'android/a2dp.c')
-rw-r--r--android/a2dp.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/android/a2dp.c b/android/a2dp.c
index 8ec03c8e8..5569691a4 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -119,8 +119,10 @@ static void unregister_endpoint(void *data)
g_free(endpoint);
}
-static void a2dp_device_free(struct a2dp_device *dev)
+static void a2dp_device_free(void *data)
{
+ struct a2dp_device *dev = data;
+
if (dev->idle_id > 0)
g_source_remove(dev->idle_id);
@@ -1471,13 +1473,6 @@ fail:
return false;
}
-static void a2dp_device_disconnected(gpointer data, gpointer user_data)
-{
- struct a2dp_device *dev = data;
-
- bt_a2dp_notify_state(dev, HAL_A2DP_STATE_DISCONNECTED);
-}
-
void bt_a2dp_unregister(void)
{
DBG("");
@@ -1488,7 +1483,7 @@ void bt_a2dp_unregister(void)
g_slist_free_full(endpoints, unregister_endpoint);
endpoints = NULL;
- g_slist_foreach(devices, a2dp_device_disconnected, NULL);
+ g_slist_free_full(devices, a2dp_device_free);
devices = NULL;
ipc_unregister(HAL_SERVICE_ID_A2DP);