From 3ae1a7c739f28b3bd6ab9a26f8b0f0b7c12be191 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Tue, 13 Aug 1996 15:04:05 +0000 Subject: *** empty log message *** --- libpager/ChangeLog | 8 ++++++++ libpager/object-terminate.c | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/libpager/ChangeLog b/libpager/ChangeLog index ed8e3cca..e8f5d305 100644 --- a/libpager/ChangeLog +++ b/libpager/ChangeLog @@ -1,3 +1,11 @@ +Tue Aug 13 10:47:47 1996 Thomas Bushnell, n/BSG + + * object-terminate.c (_pager_free_structure): Don't bother calling + mach_port_deallocate if the cells are already null; set the cells + to null after the deallocation is done. + (_pager_seqnos_memory_object_terminate): Destroy the rights passed + in for control and name. + Thu May 9 11:10:11 1996 Michael I. Bushnell, p/BSG * pager-create.c: Get rid of link warning. diff --git a/libpager/object-terminate.c b/libpager/object-terminate.c index 8598ab50..4057789f 100644 --- a/libpager/object-terminate.c +++ b/libpager/object-terminate.c @@ -53,6 +53,12 @@ _pager_seqnos_memory_object_terminate (mach_port_t object, condition_wait (&p->wakeup, &p->interlock); } + /* Destry the ports we received; mark that in P so that it doesn't bother + doing it again. */ + mach_port_destroy (mach_task_self (), control); + mach_port_destroy (mach_task_self (), name); + p->memobjcntl = p->memobjname = MACH_PORT_NULL; + _pager_free_structure (p); #ifdef KERNEL_INIT_RACE @@ -104,8 +110,16 @@ _pager_free_structure (struct pager *p) if (wakeup) condition_broadcast (&p->wakeup); - mach_port_deallocate (mach_task_self (), p->memobjcntl); - mach_port_deallocate (mach_task_self (), p->memobjname); + if (p->memobjcntl != MACH_PORT_NULL) + { + mach_port_deallocate (mach_task_self (), p->memobjcntl); + p->memobjcntl = MACH_PORT_NULL; + } + if (p->memobjname != MACH_PORT_NULL) + { + mach_port_deallocate (mach_task_self (), p->memobjname); + p->memobjname = MACH_PORT_NULL; + } /* Free the pagemap */ if (p->pagemapsize) -- cgit v1.2.3