1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Fix getting parent of not ended zone.

This commit is contained in:
Bartosz Taudul 2017-10-22 17:09:33 +02:00
parent a4f2eccbe1
commit 1967ce871a

View File

@ -2959,7 +2959,7 @@ const ZoneEvent* View::GetZoneParent( const ZoneEvent& zone ) const
{
auto it = std::upper_bound( timeline->begin(), timeline->end(), zone.start, [] ( const auto& l, const auto& r ) { return l < r->start; } );
if( it != timeline->begin() ) --it;
if( (*it)->start > zone.end ) break;
if( zone.end != -1 && (*it)->start > zone.end ) break;
if( *it == &zone ) return parent;
if( (*it)->child.empty() ) break;
parent = *it;