Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5999b7b

Browse files
authored
removed double delete of characteristics (#3521)
1 parent 7b613c1 commit 5999b7b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

‎libraries/BLE/src/BLERemoteService.cpp‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,10 @@ std::string BLERemoteService::getValue(BLEUUID characteristicUuid) {
302302
* @return N/A.
303303
*/
304304
void BLERemoteService::removeCharacteristics() {
305-
for (auto &myPair : m_characteristicMap) {
306-
delete myPair.second;
307-
//m_characteristicMap.erase(myPair.first); // Should be no need to delete as it will be deleted by the clear
308-
}
309305
m_characteristicMap.clear(); // Clear the map
310306
for (auto &myPair : m_characteristicMapByHandle) {
311307
delete myPair.second;
308+
// delete the characteristics only once
312309
}
313310
m_characteristicMapByHandle.clear(); // Clear the map
314311
} // removeCharacteristics

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /