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; } }