From ee56b717930e2cd3338dc47aa5586d3f6180d139 Mon Sep 17 00:00:00 2001 From: h2zero Date: Tue, 26 Nov 2024 14:19:26 -0700 Subject: [PATCH] Fix task not released when not exchanging MTU. --- src/NimBLEClient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NimBLEClient.cpp b/src/NimBLEClient.cpp index 1a49e0d6..ad0bfa63 100644 --- a/src/NimBLEClient.cpp +++ b/src/NimBLEClient.cpp @@ -987,6 +987,8 @@ int NimBLEClient::handleGapEvent(struct ble_gap_event* event, void* arg) { rc = pClient->m_lastErr; // sets the error in the task data break; } + + return 0; // return as we may have a task waiting for the MTU before releasing it. } } else { pClient->m_connHandle = BLE_HS_CONN_HANDLE_NONE; @@ -997,11 +999,9 @@ int NimBLEClient::handleGapEvent(struct ble_gap_event* event, void* arg) { NimBLEDevice::deleteClient(pClient); } } - - break; } - return 0; + break; } // BLE_GAP_EVENT_CONNECT case BLE_GAP_EVENT_TERM_FAILURE: {