Unable to connect to 3rd headset if already connected to 2 headsets
(with one over HFP and other over A2DP)
Global variable which contains the connection request is getting freed
So free the global data when none of device is connected.
Change-Id: Ie01c72e0560183477a3f06455a765153f2f085ad
node = g_list_next(node);
}
- if (!connected)
+ if (!connected) {
+ __bt_free_wait_data();
return BLUETOOTH_ERROR_NOT_CONNECTED;
+ }
BT_DBG("connected headset %s", connected_address);
wait_list->address);
_bt_audio_connect(wait_list->req_id, wait_list->type,
&device_address, NULL);
- _bt_rel_wait_data();
} else if (event == BLUETOOTH_EVENT_AG_CONNECTED) {
/* Add data to the connected list */
_bt_add_headset_to_list(BT_AUDIO_HSP,