]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Clear exit_functions after the exit functions have been called
authorRamiro Polla <ramiro.polla@gmail.com>
Thu, 15 Jul 2010 18:38:23 +0000 (15:38 -0300)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 16 Jul 2010 14:17:37 +0000 (16:17 +0200)
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.

exitfn.c

index 0a81793228c5dae2fac80866bc620dec5538da51..6def242de86375c133ebebf06a6d1f4eb22c23be 100644 (file)
--- a/exitfn.c
+++ b/exitfn.c
@@ -93,4 +93,5 @@ exitfn_call(void)
                p = p->next;
                free(q);
        }
+       exit_functions = NULL;
 }