mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 11:07:33 +00:00
api-server-incomplete-type-fix
libc++ eagerly instantiates the unique_ptr<APIConnection> destructor when std::array<std::unique_ptr<APIConnection>, N> is parsed, requiring sizeof(APIConnection). api_server.h only forward-declares APIConnection (via list_entities.h), so the destructor instantiation fails for any translation unit that includes api_server.h without also including api_connection.h first. Wrap the unique_ptr in a custom deleter (APIConnectionDeleter) whose operator() is defined out-of-line in api_server.cpp where APIConnection is complete. The default_delete<APIConnection> path is never instantiated, so libc++'s incomplete-type assertion is avoided. GCC/libstdc++ already deferred this instantiation, so this only affects macOS host-platform builds (used by integration tests).
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
393 MiB
Languages
C++
60.7%
Python
38.9%
C
0.3%
