From 97af778955bfc2c061c66a7a6a22b93e453a6ef6 Mon Sep 17 00:00:00 2001 From: Mathieu Carbou Date: Tue, 12 Nov 2024 18:24:53 +0100 Subject: [PATCH] Fix: Required to lock TCPIP core functionality See: https://github.com/espressif/arduino-esp32/issues/10526#issuecomment-2471122550 --- src/AsyncTCP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 595ae2f..47fba18 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -1531,10 +1531,10 @@ void AsyncServer::end(){ TCP_MUTEX_LOCK(); tcp_arg(_pcb, NULL); tcp_accept(_pcb, NULL); - TCP_MUTEX_UNLOCK(); if(tcp_close(_pcb) != ERR_OK){ _tcp_abort(_pcb, -1); } + TCP_MUTEX_UNLOCK(); _pcb = NULL; } }