cleanup the shutdown list in a manner that won't cause problems in a nested shutdown

This commit is contained in:
Bill Currie 2007-03-21 09:33:46 +00:00 committed by Jeff Teunissen
parent 1e6bc5f0a3
commit 20b8dced56
1 changed files with 5 additions and 5 deletions

View File

@ -387,12 +387,12 @@ Sys_Init_Cvars (void)
void
Sys_Shutdown (void)
{
shutdown_list_t *p = shutdown_list, *t;
shutdown_list_t *t;
while (p) {
p->func ();
t = p;
p = p->next;
while (shutdown_list) {
shutdown_list->func ();
t = shutdown_list;
shutdown_list = shutdown_list->next;
free (t);
}
}