diff --git a/top/top.c b/top/top.c index 4146ddb7..30a2fc85 100644 --- a/top/top.c +++ b/top/top.c @@ -4805,12 +4805,17 @@ static void forest_create (WIN_t *q) { #endif children = 1; } - // children found (and collapsed), so mark that puppy + /* if any children found (and collapsed), mark the parent + ( when children aren't found we won't negate the pid ) + ( to prevent a future scan since who's to say such a ) + ( task won't fork one or more children in the future ) */ if (children) Tree_ppt[parent]->pad_2 = 'x'; - // this will force a check of the next Hide_pid, if any - j = Frame_maxtask; + // this will force a check of the next Hide_pid[], if any + j = Frame_maxtask + 1; } } + // if target task disappeared (ended), prevent further scanning + if (j == Frame_maxtask) Hide_pid[i] = -Hide_pid[i]; } } }