diff --git a/openmp/tools/archer/ompt-tsan.cpp b/openmp/tools/archer/ompt-tsan.cpp --- a/openmp/tools/archer/ompt-tsan.cpp +++ b/openmp/tools/archer/ompt-tsan.cpp @@ -686,10 +686,10 @@ #endif assert(Data->RefCount == 1 && "All tasks should have finished at the implicit barrier!"); - Data->Delete(); if (type & ompt_task_initial) { - ToParallelData(parallel_data)->Delete(); + Data->Team->Delete(); } + Data->Delete(); TsanFuncExit(); break; }