mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-25 00:02:27 +00:00
hci: free memory for le connection on cancel (regression from 9fd274a)
This commit is contained in:
parent
f98fd573a1
commit
1f4510f508
@ -3395,8 +3395,9 @@ static void hci_handle_le_connection_complete_event(const uint8_t * hci_event){
|
|||||||
// reset state
|
// reset state
|
||||||
hci_stack->le_connecting_state = LE_CONNECTING_IDLE;
|
hci_stack->le_connecting_state = LE_CONNECTING_IDLE;
|
||||||
// get outgoing connection conn struct for direct connect
|
// get outgoing connection conn struct for direct connect
|
||||||
if (hci_stack->le_connecting_request == LE_CONNECTING_DIRECT){
|
|
||||||
conn = gap_get_outgoing_le_connection();
|
conn = gap_get_outgoing_le_connection();
|
||||||
|
// prepare restart if still active
|
||||||
|
if (hci_stack->le_connecting_request == LE_CONNECTING_DIRECT){
|
||||||
conn->state = SEND_CREATE_CONNECTION;
|
conn->state = SEND_CREATE_CONNECTION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3414,7 +3415,7 @@ static void hci_handle_le_connection_complete_event(const uint8_t * hci_event){
|
|||||||
// - connection cancelled by user
|
// - connection cancelled by user
|
||||||
// by this, no event is emitted for intermediate connection cancel required filterlist modification
|
// by this, no event is emitted for intermediate connection cancel required filterlist modification
|
||||||
if ((connection_was_cancelled == false) || cancelled_by_user){
|
if ((connection_was_cancelled == false) || cancelled_by_user){
|
||||||
hci_emit_event(gap_event, sizeof(gap_event), 1);
|
hci_emit_btstack_event(gap_event, sizeof(gap_event), 1);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user