Fix: Required to lock TCPIP core functionality

See: https://github.com/espressif/arduino-esp32/issues/10526#issuecomment-2471122550
This commit is contained in:
Mathieu Carbou
2024-11-12 18:24:53 +01:00
parent 48a37dedf6
commit d250960259

View File

@@ -1531,9 +1531,11 @@ void AsyncServer::end(){
TCP_MUTEX_LOCK();
tcp_arg(_pcb, NULL);
tcp_accept(_pcb, NULL);
TCP_MUTEX_UNLOCK();
if(tcp_close(_pcb) != ERR_OK){
TCP_MUTEX_UNLOCK();
_tcp_abort(_pcb, -1);
} else {
TCP_MUTEX_UNLOCK();
}
_pcb = NULL;
}