Unverified Commit 5fcdb841 authored by Chester's avatar Chester Committed by GitHub

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: default avatarLucas Saavedra Vaz <lucassvaz@yahoo.com.br>

---------
Co-authored-by: default avatarLucas Saavedra Vaz <lucas.vaz@espressif.com>
Co-authored-by: default avatarLucas Saavedra Vaz <lucassvaz@yahoo.com.br>
parent 8985a77e
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment