shared/bap: Fix not unregistering idle callback on detach
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 13 Mar 2023 22:51:47 +0000 (15:51 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 10:21:48 +0000 (15:51 +0530)
This make sure idle callback is unregistered before bt_gatt_client is
unref.

src/shared/bap.c

index 952b7be..7a53fbc 100644 (file)
@@ -3818,6 +3818,8 @@ void bt_bap_detach(struct bt_bap *bap)
                bap->req = NULL;
        }
 
+       bt_gatt_client_idle_unregister(bap->client, bap->idle_id);
+
        /* Cancel queued requests */
        queue_remove_all(bap->reqs, NULL, NULL, bap_req_detach);