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 8930f4a977
commit 19abafa43f
+2 -2
View File
@@ -1693,8 +1693,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) {
@@ -1705,6 +1703,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;