From bf761682a04c0c87932b8f5f60e7ee9859acf7b6 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Wed, 6 Apr 1994 19:28:33 +0000 Subject: Formerly mgt.c.~3~ --- proc/mgt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/proc/mgt.c b/proc/mgt.c index c4b8d0e3..37d4e43a 100644 --- a/proc/mgt.c +++ b/proc/mgt.c @@ -606,15 +606,20 @@ add_tasks (task_t task) processor_set_tasks (psetpriv, &tasks, &ntasks); for (j = 0; j < ntasks; j++) { + int set = 0; if (!foundp) { struct proc *p = task_find_nocreate (tasks[j]); if (!p) - p = new_proc (tasks[j]); + { + p = new_proc (tasks[j]); + set = 1; + } if (!foundp && tasks[j] == task) foundp = p; } - mach_port_deallocate (mach_task_self (), tasks[j]); + if (!set) + mach_port_deallocate (mach_task_self (), tasks[j]); } vm_deallocate (mach_task_self (), (vm_address_t) tasks, ntasks * sizeof (task_t)); -- cgit v1.2.3