fix bug whereby most atexit-registered functions got skipped
This commit is contained in:
parent
04109502c0
commit
a749ba3adc
1 changed files with 2 additions and 3 deletions
|
|
@ -21,9 +21,8 @@ void __funcs_on_exit()
|
|||
int i;
|
||||
void (*func)(void *), *arg;
|
||||
LOCK(lock);
|
||||
for (; head; head=head->next) {
|
||||
for (i=COUNT-1; i>=0 && !head->f[i]; i--);
|
||||
if (i<0) continue;
|
||||
for (; head; head=head->next) for (i=COUNT-1; i>=0; i--) {
|
||||
if (!head->f[i]) continue;
|
||||
func = head->f[i];
|
||||
arg = head->a[i];
|
||||
head->f[i] = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue