From 59632f0d3710c34a51e843c4c5a3cda13dd8ab8e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 29 Sep 2019 20:17:47 +0200 Subject: [PATCH] One more place to check if srcloc zones are ready. --- server/TracyView.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index fad4adbd..6511a6ac 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -5386,9 +5386,12 @@ void View::DrawZoneInfoWindow() TextFocused( "Time from start of program:", TimeToString( ev.Start() ) ); TextFocused( "Execution time:", TimeToString( ztime ) ); #ifndef TRACY_NO_STATISTICS - auto& zoneData = m_worker.GetZonesForSourceLocation( ev.SrcLoc() ); - ImGui::SameLine(); - ImGui::TextDisabled( "(%.2f%% of average time)", float( ztime ) / zoneData.total * zoneData.zones.size() * 100 ); + if( m_worker.AreSourceLocationZonesReady() ) + { + auto& zoneData = m_worker.GetZonesForSourceLocation( ev.SrcLoc() ); + ImGui::SameLine(); + ImGui::TextDisabled( "(%.2f%% of average time)", float( ztime ) / zoneData.total * zoneData.zones.size() * 100 ); + } #endif TextFocused( "Self time:", TimeToString( selftime ) ); if( ztime != 0 )