mirror of
https://github.com/espressif/arduino-esp32
synced 2024-09-21 10:28:04 +00:00
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>
This commit is contained in:
parent
8985a77e3e
commit
5fcdb8412d
@ -520,10 +520,9 @@ 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.
|
||||
m_descriptorMap.clear();
|
||||
} // removeCharacteristics
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user