From e9ce8fdfda606f1b98167268d5f49219b809034b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 21 Dec 2018 18:14:30 +0100 Subject: [PATCH] Flush queues when opening listen socket fails. --- client/TracyProfiler.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index f30e4793..6d50aebb 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -933,7 +933,19 @@ void Profiler::Worker() moodycamel::ConsumerToken token( s_queue ); ListenSocket listen; - listen.Listen( "8086", 8 ); + if( !listen.Listen( "8086", 8 ) ) + { + for(;;) + { + if( ShouldExit() ) + { + m_shutdownFinished.store( true, std::memory_order_relaxed ); + return; + } + + ClearQueues( token ); + } + } for(;;) {