mirror of
https://github.com/esphome/esphome.git
synced 2026-09-26 14:30:23 +00:00
[core] fast_select scan removal: address review feedback
- Drop redundant cached_sock_ = nullptr assignment in close(). After closed_ = true the socket is a corpse and no ready() or other member access is valid, so the nulling is not load-bearing. The comment now explains why on both impl variants. - Reword the yield_with_select_ comment so the wake-source sentence reads as a complete list rather than a trailing fragment.
This commit is contained in:
@@ -34,11 +34,10 @@ BSDSocketImpl::~BSDSocketImpl() {
|
||||
|
||||
int BSDSocketImpl::close() {
|
||||
if (!this->closed_) {
|
||||
#ifdef USE_LWIP_FAST_SELECT
|
||||
// All LwIP sockets share the same static event_callback, so there is no per-socket
|
||||
// unhook needed — just drop the cached pointer before the socket is destroyed.
|
||||
this->cached_sock_ = nullptr;
|
||||
#else
|
||||
#ifndef USE_LWIP_FAST_SELECT
|
||||
// All LwIP sockets share the same static event_callback, so on the fast-select path
|
||||
// there is no per-socket unhook needed. cached_sock_ is not cleared because closed_
|
||||
// makes the socket a corpse — no ready() or other member access is valid afterwards.
|
||||
if (this->loop_monitored_) {
|
||||
App.unregister_socket_fd(this->fd_);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user