From 20b8dced5694ca747e0e4967fd39624fa3df94f1 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 21 Mar 2007 09:33:46 +0000 Subject: [PATCH] cleanup the shutdown list in a manner that won't cause problems in a nested shutdown --- libs/util/sys.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/util/sys.c b/libs/util/sys.c index 16f6398e2..bc473aca8 100644 --- a/libs/util/sys.c +++ b/libs/util/sys.c @@ -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); } }