scheme_add_atexit_closer now uses scheme_atexit.

This is because calling atexit is not correct in all
situations, namely on old operating systems.
This commit is contained in:
Leif Andersen 2017-06-04 08:56:07 -04:00
parent a8fa5d4ebb
commit 5510a76dca
No known key found for this signature in database
GPG Key ID: BB90BDDE4DBF7C16

View File

@ -1966,15 +1966,7 @@ void scheme_add_atexit_closer(Scheme_Exit_Closer_Func f)
if (!cust_closers) {
if (RUNNING_IN_ORIGINAL_PLACE) {
if (replacement_at_exit) {
replacement_at_exit(do_run_atexit_closers_on_all);
} else {
#ifdef USE_ON_EXIT_FOR_ATEXIT
on_exit(do_run_atexit_closers_on_all, NULL);
#else
atexit(do_run_atexit_closers_on_all);
#endif
}
scheme_atexit(do_run_atexit_closers_on_all);
}
REGISTER_SO(cust_closers);
@ -1986,7 +1978,15 @@ void scheme_add_atexit_closer(Scheme_Exit_Closer_Func f)
int scheme_atexit(void (*func)(void))
{
if (replacement_at_exit) {
return replacement_at_exit(func);
} else {
#ifdef USE_ON_EXIT_FOR_ATEXIT
return on_exit(func, NULL);
#else
return atexit(func);
#endif
}
}
void scheme_schedule_custodian_close(Scheme_Custodian *c)