Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 2/2] android/A2DP: Fix sending notification on bt_a2dp_unregister
Date: Mon, 20 Jan 2014 14:25:27 +0200	[thread overview]
Message-ID: <1390220727-21494-2-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1390220727-21494-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

At this point IPC might have been closed already.
---
 android/a2dp.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/android/a2dp.c b/android/a2dp.c
index 8ec03c8..5569691 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);
-- 
1.8.4.2


  reply	other threads:[~2014-01-20 12:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 12:25 [PATCH BlueZ 1/2] android/hal-audio: Fix not closing audio_sk Luiz Augusto von Dentz
2014-01-20 12:25 ` Luiz Augusto von Dentz [this message]
2014-01-21 11:41   ` [PATCH BlueZ 2/2] android/A2DP: Fix sending notification on bt_a2dp_unregister Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390220727-21494-2-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox