From 7c2bb058a54306283faf48d5b98fb0f0e5b48086 Mon Sep 17 00:00:00 2001 From: Rapsssito Date: Mon, 1 Jul 2024 13:27:25 +0200 Subject: [PATCH] Avoid cppcoreguidelines-owning-memory --- esphome/components/esp32_ble_server/ble_server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/esp32_ble_server/ble_server.cpp b/esphome/components/esp32_ble_server/ble_server.cpp index 7e4575999f..897d775da7 100644 --- a/esphome/components/esp32_ble_server/ble_server.cpp +++ b/esphome/components/esp32_ble_server/ble_server.cpp @@ -18,7 +18,7 @@ namespace esphome { namespace esp32_ble_server { Trigger *BLEServerAutomationInterface::create_on_write_trigger(BLECharacteristic *characteristic) { - Trigger *on_write_trigger = new Trigger(); + Trigger *on_write_trigger = new Trigger(); // NOLINT(cppcoreguidelines-owning-memory) characteristic->on_write([on_write_trigger](const std::vector &data) { std::string value(data.begin(), data.end()); on_write_trigger->trigger(value); @@ -151,8 +151,8 @@ BLEService *BLEServer::create_service(ESPBTUUID uuid, bool advertise, uint16_t n ESP_LOGW(TAG, "Could not create BLE service %s, too many instances", uuid.to_string().c_str()); return nullptr; } - BLEService *service = - new BLEService(uuid, num_handles, inst_id, advertise); // NOLINT(cppcoreguidelines-owning-memory) + BLEService *service = // NOLINT(cppcoreguidelines-owning-memory) + new BLEService(uuid, num_handles, inst_id, advertise); this->services_.emplace(BLEServer::get_service_key(uuid, inst_id), service); if (this->parent_->is_active() && this->registered_) { service->do_create(this);