From 192493a2c32457c78afbb50b73c9b36a858e073b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 25 Sep 2017 01:20:22 +0200 Subject: [PATCH] Store proper children in edge-case code. --- server/TracyView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index b499e7a8..78cd8262 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -406,14 +406,14 @@ void View::InsertZone( Event* zone, Event* parent, Vector& vec ) { zone->parent = parent; - // here be dragons - // this code is not tested, as it's a fallback for edge cases, which haven't happened if( zone->end == -1 ) { + // here be dragons + // this code is not tested, as it's a fallback for edge cases, which haven't happened for( auto zit = it; zit != vec.end(); ++zit ) { (*zit)->parent = zone; - zone->child.push_back( zone ); + zone->child.push_back( *zit ); } vec.erase( it, vec.end() ); vec.push_back( zone ); @@ -424,7 +424,7 @@ void View::InsertZone( Event* zone, Event* parent, Vector& vec ) for( auto zit = it; zit != eit; zit++ ) { (*zit)->parent = zone; - zone->child.push_back( zone ); + zone->child.push_back( *zit ); } auto nit = vec.erase( it, eit ); vec.insert( nit, zone );