From 8dabe4760214c12d4f1d8983168d8eedde8c821a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 18 Mar 2018 21:03:36 +0100 Subject: [PATCH] Stop processing new zones on invalid time span. When processing will resume in the next frame, the zone will hopefully have a proper end time. --- server/TracyView.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index fac3f7f0..386442c0 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3134,23 +3134,35 @@ void View::DrawFindZone() auto& zones = m_worker.GetZonesForSourceLocation( m_findZone.match[m_findZone.selMatch] ).zones; auto sz = zones.size(); - for( size_t i=m_findZone.processed; iend == -1 ) break; const auto end = m_worker.GetZoneEndDirect( *ev.zone ); const auto timespan = end - ev.zone->start; + if( timespan == 0 ) + { + processed++; + continue; + } if( m_findZone.highlight.active ) { const auto s = std::min( m_findZone.highlight.start, m_findZone.highlight.end ); const auto e = std::max( m_findZone.highlight.start, m_findZone.highlight.end ); - if( timespan < s || timespan > e ) continue; + if( timespan < s || timespan > e ) + { + processed++; + continue; + } } + processed++; m_findZone.threads[ev.thread].emplace_back( ev.zone ); } - m_findZone.processed = sz; + m_findZone.processed = processed; int idx = 0; for( auto& v : m_findZone.threads )