From bd108220cbd8e3a780b080de6af7d832c704ce06 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 23 Oct 2021 01:54:38 +0200 Subject: [PATCH] Drain symbols queue if on-demand and not connected. --- client/TracyProfiler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 4eb59c40..4e952151 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -3144,8 +3144,16 @@ void Profiler::SymbolWorker() for(;;) { const auto shouldExit = ShouldExit(); - SymbolQueueItem si; +#ifdef TRACY_ON_DEMAND + if( !IsConnected() ) + { + if( shouldExit ) return; + while( m_symbolQueue.pop() ) {} + std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); + continue; + } +#endif if( m_symbolQueue.try_dequeue( si ) ) { HandleSymbolQueueItem( si );