From 39ece2aaf3305f78a8c5f8c7aa56ef82541e3931 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 30 Dec 2025 14:17:05 +0100 Subject: Fix two race conditions when startup fails --- lib/Socket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Socket.cpp') diff --git a/lib/Socket.cpp b/lib/Socket.cpp index da9031f..580618c 100644 --- a/lib/Socket.cpp +++ b/lib/Socket.cpp @@ -1107,11 +1107,11 @@ TCPDataDispatcher::TCPDataDispatcher(size_t max_queue_size, size_t buffers_to_pr TCPDataDispatcher::~TCPDataDispatcher() { m_running = false; - m_connections.clear(); - m_listener_socket.close(); if (m_listener_thread.joinable()) { m_listener_thread.join(); } + m_listener_socket.close(); + m_connections.clear(); } void TCPDataDispatcher::start(int port, const string& address) -- cgit v1.2.3