From: Ramiro Polla Date: Thu, 15 Jul 2010 18:38:23 +0000 (-0300) Subject: Clear exit_functions after the exit functions have been called X-Git-Tag: v3.1~185 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bdaeb12a0c49c104eddcd8e47f351924bb4d8f1;p=thirdparty%2Fccache.git Clear exit_functions after the exit functions have been called While execve() does not run the functions registered with atexit() and they must therefore be called explicitly prior to the call to execve(), the Windows replacement function will end up running the atexit() hooks twice, and clearing the pointer prevents the functions from actually running twice. --- diff --git a/exitfn.c b/exitfn.c index 0a8179322..6def242de 100644 --- a/exitfn.c +++ b/exitfn.c @@ -93,4 +93,5 @@ exitfn_call(void) p = p->next; free(q); } + exit_functions = NULL; }