diff --git a/Sming/Arch/Host/Components/hostlib/startup.cpp b/Sming/Arch/Host/Components/hostlib/startup.cpp index 519a330b96..31db5453de 100644 --- a/Sming/Arch/Host/Components/hostlib/startup.cpp +++ b/Sming/Arch/Host/Components/hostlib/startup.cpp @@ -255,5 +255,8 @@ int main(int argc, char* argv[]) pause(config.exitpause); + // Avoid issues with debug statements whilst running exit handlers + m_setPuts(nullptr); + return exitCode; } diff --git a/Sming/Core/Network/TcpConnection.cpp b/Sming/Core/Network/TcpConnection.cpp index d517ff57ed..d19c46425c 100644 --- a/Sming/Core/Network/TcpConnection.cpp +++ b/Sming/Core/Network/TcpConnection.cpp @@ -499,12 +499,11 @@ err_t TcpConnection::staticOnPoll(void* arg, tcp_pcb* tcp) err_t TcpConnection::internalOnPoll() { - //if (tcp->state != ESTABLISHED) - // return ERR_OK; - sleep++; err_t res = onPoll(); - checkSelfFree(); + if(res == ERR_OK) { + checkSelfFree(); + } debug_tcp_ext("