1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-17 23:35:47 +00:00

Fix descriptors not being deleted (#4104)

This commit is contained in:
J. Nick Koston
2022-11-28 08:49:41 -10:00
committed by GitHub
parent 1166d93805
commit 75573a3ed1
7 changed files with 26 additions and 6 deletions

View File

@@ -29,6 +29,13 @@ BLEService::~BLEService() {
delete chr; // NOLINT(cppcoreguidelines-owning-memory)
}
void BLEService::release_characteristics() {
this->parsed = false;
for (auto &chr : this->characteristics)
delete chr; // NOLINT(cppcoreguidelines-owning-memory)
this->characteristics.clear();
}
void BLEService::parse_characteristics() {
this->parsed = true;
uint16_t offset = 0;