From aac0a36a2d8e17a6f2e45e4bd656586983165967 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 7 Sep 2019 17:23:11 +0200 Subject: [PATCH] Don't use source location zones before they are ready. --- server/TracyView.cpp | 2 +- server/TracyWorker.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 12625de8..4d3bd320 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1251,7 +1251,7 @@ void View::DrawFrames() } int i = 0, idx = 0; - if( m_findZone.show && !m_findZone.match.empty() ) + if( m_worker.AreSourceLocationZonesReady() && m_findZone.show && !m_findZone.match.empty() ) { auto& zoneData = m_worker.GetZonesForSourceLocation( m_findZone.match[m_findZone.selMatch] ); auto begin = zoneData.zones.begin(); diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 70a27b72..e8a22bb7 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2035,6 +2035,7 @@ std::vector Worker::GetMatchingSourceLocation( const char* query, bool #ifndef TRACY_NO_STATISTICS const Worker::SourceLocationZones& Worker::GetZonesForSourceLocation( int16_t srcloc ) const { + assert( AreSourceLocationZonesReady() ); static const SourceLocationZones empty; auto it = m_data.sourceLocationZones.find( srcloc ); return it != m_data.sourceLocationZones.end() ? it->second : empty;