Index: src/kmp_tasking.c =================================================================== --- src/kmp_tasking.c +++ src/kmp_tasking.c @@ -578,7 +578,8 @@ { // Proxy tasks must always be allowed to free their parents // because they can be run in background even in serial mode. - kmp_int32 task_serial = taskdata->td_flags.task_serial && !taskdata->td_flags.proxy; + kmp_int32 team_serial = ( taskdata->td_flags.team_serial || + taskdata->td_flags.tasking_ser ) && !taskdata->td_flags.proxy; KMP_DEBUG_ASSERT( taskdata -> td_flags.tasktype == TASK_EXPLICIT ); kmp_int32 children = KMP_TEST_THEN_DEC32( (kmp_int32 *)(& taskdata -> td_allocated_child_tasks) ) - 1; @@ -599,7 +600,7 @@ // Stop checking ancestors at implicit task // instead of walking up ancestor tree to avoid premature deallocation of ancestors. - if ( task_serial || taskdata -> td_flags.tasktype == TASK_IMPLICIT ) + if ( team_serial || taskdata -> td_flags.tasktype == TASK_IMPLICIT ) return; // Predecrement simulated by "- 1" calculation