From 45f1db9233c8f9243cbee94489d7ba924b773ab3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 30 Jun 2025 21:20:58 -0500 Subject: [PATCH] address review comments --- esphome/core/component.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/esphome/core/component.cpp b/esphome/core/component.cpp index e45417d5aa..e7ac4fecbc 100644 --- a/esphome/core/component.cpp +++ b/esphome/core/component.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "esphome/core/application.h" #include "esphome/core/hal.h" #include "esphome/core/helpers.h" @@ -21,6 +22,10 @@ static const char *const TAG = "component"; // Component error messages - only stores messages for failed components // Lazy allocated since most configs have zero failures +// Note: We don't clear this vector because: +// 1. Components are never destroyed in ESPHome +// 2. Failed components remain failed (no recovery mechanism) +// 3. Memory usage is minimal (only failures with custom messages are stored) static std::unique_ptr>> g_component_error_messages; // Setup priority overrides - freed after setup completes