Subject: NetBSD master CVS tree commits
To: None <source-changes@NetBSD.ORG>
From: None <source@NetBSD.ORG>
List: source-changes
Date: 11/24/1996 00:50:02
cgd
Sat Nov 23 16:42:32 PST 1996
Update of /cvsroot/src/sys/kern
In directory netbsd1:/var/slash-tmp/cvs-serv27124

Modified Files:
	kern_subr.c 
Log Message:
fix two problems with shutdown hook code:
(1) after removing a shutdown hook (in shutdownhook_disestablish()),
    free it.  We created it, we have to free it.  Without this,
    shutdownhook_disestablish() leaks memory.
(2) in doshutdownhooks(), before running each hook, remove it from the
    shutdown hook list.  This makes sure that every hook is tried once
    (because doshutdownhooks() is called from before rebooting, and
    a fault in a shutdown hook will cause doshutdownhooks() to be called
    again), but prevents the hooks from potentially being run infinitely
    (as used to be possible, in the above-mentioned situation).