From 227097a36e5a03dcfbc7e6afa33c67f7400ba1f5 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 11 Sep 2026 20:59:26 -0500 Subject: [PATCH] Revert "[core] Construct App without value initialization too" This reverts commit 1080e9d285364fd3eb58ae7308c9c65ad6e97c1b. --- esphome/core/config.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/esphome/core/config.py b/esphome/core/config.py index 4b192e84959..67a7b5210ee 100644 --- a/esphome/core/config.py +++ b/esphome/core/config.py @@ -717,12 +717,9 @@ async def to_code(config: ConfigType) -> None: cg.add_global(cg.RawExpression("using std::min")) cg.add_global(cg.RawExpression("using std::max")) - # Construct App via placement new — see application.cpp for storage details. - # No parentheses: Application has no user provided ctor, so `Application()` - # would zero-fill the whole object before the ctor runs. The storage is - # already zero. + # Construct App via placement new — see application.cpp for storage details cg.add_global(cg.RawStatement("#include ")) - cg.add(cg.RawExpression("new (&App) Application")) + cg.add(cg.RawExpression("new (&App) Application()")) name = config[CONF_NAME] friendly_name = config[CONF_FRIENDLY_NAME] name_add_mac_suffix = config[CONF_NAME_ADD_MAC_SUFFIX]