From f48eff29c3ae5017915523b4068bcbe585e5d968 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 27 Mar 2026 15:54:40 -1000 Subject: [PATCH] =?UTF-8?q?Fix=20::operator=20new=20/=20delete[]=20mismatc?= =?UTF-8?q?h=20=E2=80=94=20use=20::operator=20delete=20to=20match?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esphome/core/helpers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index a2b33dd7b1..f68ad5a9f6 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -420,7 +420,7 @@ template::max()> if constexpr (std::is_trivially_copyable::value && std::is_trivially_default_constructible::value) { ::operator delete(this->data_); } else { - delete[] this->data_; + ::operator delete(this->data_); } } @@ -1804,7 +1804,7 @@ template class CallbackManager { public: CallbackManager() = default; - ~CallbackManager() { delete[] this->data_; } + ~CallbackManager() { ::operator delete(this->data_); } // Non-copyable (would alias data_), movable (for std::map support) CallbackManager(const CallbackManager &) = delete; @@ -1817,7 +1817,7 @@ template class CallbackManager { } CallbackManager &operator=(CallbackManager &&other) noexcept { if (this != &other) { - delete[] this->data_; + ::operator delete(this->data_); this->data_ = other.data_; this->size_ = other.size_; this->capacity_ = other.capacity_;