Skip to content

Commit

Permalink
removed double delete of characteristics (espressif#3521)
Browse files Browse the repository at this point in the history
  • Loading branch information
rng0x17 authored Sep 30, 2020
1 parent 7b613c1 commit 5999b7b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions libraries/BLE/src/BLERemoteService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,10 @@ std::string BLERemoteService::getValue(BLEUUID characteristicUuid) {
* @return N/A.
*/
void BLERemoteService::removeCharacteristics() {
for (auto &myPair : m_characteristicMap) {
delete myPair.second;
//m_characteristicMap.erase(myPair.first); // Should be no need to delete as it will be deleted by the clear
}
m_characteristicMap.clear(); // Clear the map
for (auto &myPair : m_characteristicMapByHandle) {
delete myPair.second;
// delete the characteristics only once
}
m_characteristicMapByHandle.clear(); // Clear the map
} // removeCharacteristics
Expand Down

0 comments on commit 5999b7b

Please sign in to comment.