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