From 0941d7a634c6ab98257d2948e40d57efeee66a88 Mon Sep 17 00:00:00 2001 From: Chester Date: Thu, 30 Mar 2023 16:29:30 +0800 Subject: [PATCH 1/2] Update BLERemoteCharacteristic.cpp Fix kernel panic issue when trying to release BLEClient when the target device have a ble descriptor. --- libraries/BLE/src/BLERemoteCharacteristic.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/BLE/src/BLERemoteCharacteristic.cpp b/libraries/BLE/src/BLERemoteCharacteristic.cpp index 825ca33c73b..54e10d70cc0 100644 --- a/libraries/BLE/src/BLERemoteCharacteristic.cpp +++ b/libraries/BLE/src/BLERemoteCharacteristic.cpp @@ -517,7 +517,6 @@ void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback, void BLERemoteCharacteristic::removeDescriptors() { // Iterate through all the descriptors releasing their storage and erasing them from the map. for (auto &myPair : m_descriptorMap) { - m_descriptorMap.erase(myPair.first); delete myPair.second; } m_descriptorMap.clear(); // Technically not neeeded, but just to be sure. From 6a4635234d634cccc9afd258a2870c12b704b360 Mon Sep 17 00:00:00 2001 From: Chester Date: Thu, 30 Nov 2023 11:43:44 +0800 Subject: [PATCH 2/2] Update BLERemoteCharacteristic.cpp Co-authored-by: Lucas Saavedra Vaz --- libraries/BLE/src/BLERemoteCharacteristic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/BLE/src/BLERemoteCharacteristic.cpp b/libraries/BLE/src/BLERemoteCharacteristic.cpp index d8543bc6bba..620951b66c8 100644 --- a/libraries/BLE/src/BLERemoteCharacteristic.cpp +++ b/libraries/BLE/src/BLERemoteCharacteristic.cpp @@ -522,7 +522,7 @@ void BLERemoteCharacteristic::removeDescriptors() { for (auto &myPair : m_descriptorMap) { delete myPair.second; } - m_descriptorMap.clear(); // Technically not neeeded, but just to be sure. + m_descriptorMap.clear(); } // removeCharacteristics