After detaching a bt_bap session, each plugin that registered a bap detached callback will be notified. The bt_bap user data should be set when calling these callbacks, so the bt_bap session can be matched to the associated service and the cleanup is handled accordingly. --- profiles/audio/bap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index c503f250c..6d2afa2c0 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -192,10 +192,8 @@ static void bap_data_free(struct bap_data *data) if (data->io_id) g_source_remove(data->io_id); - if (data->service && btd_service_get_user_data(data->service) == data) { + if (data->service && btd_service_get_user_data(data->service) == data) btd_service_set_user_data(data->service, NULL); - bt_bap_set_user_data(data->bap, NULL); - } queue_destroy(data->snks, ep_unregister); queue_destroy(data->srcs, ep_unregister); -- 2.43.0