fix(nimble): delete connection after lookup in ble_gap_conn_broken

This commit is contained in:
Shreeyash
2026-02-05 16:27:54 +05:30
committed by Rahul Tank
parent 0fb1f1ef11
commit 27b6525dbc
+2 -2
View File
@@ -1800,8 +1800,6 @@ ble_gap_conn_broken(uint16_t conn_handle, int reason)
ble_gap_event_connect_call(conn_handle, BLE_HS_EAGAIN);
}
ble_hs_atomic_conn_delete(conn_handle);
ble_hs_lock();
conn = ble_hs_conn_find(conn_handle);
if (conn != NULL) {
@@ -1812,6 +1810,8 @@ ble_gap_conn_broken(uint16_t conn_handle, int reason)
}
ble_hs_unlock();
ble_hs_atomic_conn_delete(conn_handle);
event.type = BLE_GAP_EVENT_DISCONNECT;
event.disconnect.reason = reason;