You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/05/17 20:52:09 UTC

[46/50] [abbrv] incubator-mynewt-core git commit: BLE Host - disconn: delete conn before app cb.

BLE Host - disconn: delete conn before app cb.

If the app wants to create a new connection as a result of the existing
connection being destroyed, we need to free the memory first.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/79f32b11
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/79f32b11
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/79f32b11

Branch: refs/heads/master
Commit: 79f32b111901e9f83a0a6b6da05d1cff50deebbf
Parents: 65b4cc3
Author: Christopher Collins <cc...@apache.org>
Authored: Tue May 17 13:28:59 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue May 17 13:30:03 2016 -0700

----------------------------------------------------------------------
 net/nimble/host/src/ble_gap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/79f32b11/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index 5dc3078..7dbbbac 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -496,6 +496,8 @@ ble_gap_conn_broken(struct ble_gap_snapshot *snap, int status)
 {
     struct ble_gap_conn_ctxt ctxt;
 
+    ble_hs_atomic_conn_delete(snap->desc.conn_handle);
+
     ble_gattc_connection_broken(snap->desc.conn_handle);
     ble_l2cap_sm_connection_broken(snap->desc.conn_handle);
 
@@ -503,7 +505,6 @@ ble_gap_conn_broken(struct ble_gap_snapshot *snap, int status)
     ctxt.desc = &snap->desc;
     ble_gap_call_conn_cb(BLE_GAP_EVENT_CONN, status, &ctxt,
                          snap->cb, snap->cb_arg);
-    ble_hs_atomic_conn_delete(snap->desc.conn_handle);
 
     STATS_INC(ble_gap_stats, disconnect);
 }