From 1cf2da8d67e521319cabd0cd070e27f1399796ff Mon Sep 17 00:00:00 2001 From: baohongde Date: Tue, 29 Oct 2019 19:47:50 +0800 Subject: [PATCH] components/bt: Fix assert when deinit A2DP while playing music --- .../bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.c | 2 ++ .../bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.c b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.c index 9ef243231c..8646775b21 100644 --- a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.c +++ b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.c @@ -747,6 +747,8 @@ static void btc_a2dp_sink_thread_cleanup(UNUSED_ATTR void *context) fixed_queue_free(a2dp_sink_local_param.btc_aa_snk_cb.RxSbcQ, osi_free_func); + a2dp_sink_local_param.btc_aa_snk_cb.RxSbcQ = NULL; + future_ready(a2dp_sink_local_param.btc_a2dp_sink_future, NULL); } diff --git a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c index aff5521139..271c1b87d4 100644 --- a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c +++ b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c @@ -1615,6 +1615,8 @@ static void btc_a2dp_source_thread_cleanup(UNUSED_ATTR void *context) fixed_queue_free(a2dp_source_local_param.btc_aa_src_cb.TxAaQ, osi_free_func); + a2dp_source_local_param.btc_aa_src_cb.TxAaQ = NULL; + future_ready(a2dp_source_local_param.btc_a2dp_source_future, NULL); }