diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2019-08-15 19:34:14 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2019-08-15 21:17:36 +0300 |
commit | 350e526ec0c7fbdd17918919b72e4ca32371c129 (patch) | |
tree | b5f89f207b8c8fcee1a588149242df932bd7827c /server/TracyView.cpp | |
parent | b322d20c1904ab8571786a18b1a870910e5abe9d (diff) |
Fix crash when zone exists before thread context switches appear.
Diffstat (limited to 'server/TracyView.cpp')
-rw-r--r-- | server/TracyView.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/TracyView.cpp b/server/TracyView.cpp index eefc86dc..62ed4b7c 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4704,7 +4704,7 @@ void View::DrawZoneInfoWindow() TextFocused( "Running state regions:", "1" ); } } - else + else if( cnt > 1 ) { if( incomplete ) { @@ -11712,6 +11712,7 @@ bool View::GetZoneRunningTime( const ContextSwitch* ctx, const ZoneEvent& ev, in const auto eit = std::upper_bound( it, ctx->v.end(), end, [] ( const auto& l, const auto& r ) { return l < r.start; } ); if( eit == ctx->v.end() ) return false; cnt = std::distance( it, eit ); + if( cnt == 0 ) return false; if( cnt == 1 ) { time = end - ev.start; |