Skip to content

Commit 5fcdb84

Browse files
Kernel panic when delete BLEClient object with descriptor characteristic (#8010)
* Update BLERemoteCharacteristic.cpp Fix kernel panic issue when trying to release BLEClient when the target device have a ble descriptor. * Update BLERemoteCharacteristic.cpp Co-authored-by: Lucas Saavedra Vaz <lucassvaz@yahoo.com.br> --------- Co-authored-by: Lucas Saavedra Vaz <lucas.vaz@espressif.com> Co-authored-by: Lucas Saavedra Vaz <lucassvaz@yahoo.com.br>
1 parent 8985a77 commit 5fcdb84

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libraries/BLE/src/BLERemoteCharacteristic.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,9 @@ void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback,
520520
void BLERemoteCharacteristic::removeDescriptors() {
521521
// Iterate through all the descriptors releasing their storage and erasing them from the map.
522522
for (auto &myPair : m_descriptorMap) {
523-
m_descriptorMap.erase(myPair.first);
524523
delete myPair.second;
525524
}
526-
m_descriptorMap.clear(); // Technically not neeeded, but just to be sure.
525+
m_descriptorMap.clear();
527526
} // removeCharacteristics
528527

529528

0 commit comments

Comments
 (0)