finally fix attachProfileCountersScope

This commit is contained in:
vdimir 2023-02-20 12:28:44 +00:00
parent 0d6c6a94de
commit 78c35ffc45
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862

View File

@ -169,8 +169,10 @@ ProfileEvents::Counters * ThreadStatus::attachProfileCountersScope(ProfileEvents
/// Allow to attach the same scope multiple times
return prev_counters;
if (!performance_counters_scope->getParent())
/// Avoid cycles when exiting local scope and attaching back to current thread counters
if (performance_counters_scope != &performance_counters)
performance_counters_scope->setParent(&performance_counters);
current_performance_counters = performance_counters_scope;
return prev_counters;