未验证 提交 5999b7ba 编写于 作者: C crnchbng 提交者: GitHub

removed double delete of characteristics (#3521)

上级 7b613c12
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册