From 5aacadd0760edf971b003a492c8c24e6603a95ff Mon Sep 17 00:00:00 2001 From: ackimixs Date: Wed, 15 May 2024 22:34:34 +0200 Subject: [PATCH] do not close if already closed :) --- src/TCPClient.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/TCPClient.cpp b/src/TCPClient.cpp index 6f5b543..c83a18a 100644 --- a/src/TCPClient.cpp +++ b/src/TCPClient.cpp @@ -77,8 +77,10 @@ void TCPClient::start() { } void TCPClient::stop() { - running = false; - close(clientSocket); + if (running) { + running = false; + close(clientSocket); + } } bool TCPClient::shouldStop() const {