places: avoid redundant atexit() registrations
Register only in the original place.
This commit is contained in:
parent
8035ee354c
commit
0c13a4a1f1
|
@ -1845,7 +1845,13 @@ void scheme_set_atexit(Scheme_At_Exit_Proc p)
|
||||||
|
|
||||||
void scheme_add_atexit_closer(Scheme_Exit_Closer_Func f)
|
void scheme_add_atexit_closer(Scheme_Exit_Closer_Func f)
|
||||||
{
|
{
|
||||||
if (!cust_closers) {
|
#if defined(MZ_USE_PLACES)
|
||||||
|
# define RUNNING_IN_ORIGINAL_PLACE (scheme_current_place_id == 0)
|
||||||
|
#else
|
||||||
|
# define RUNNING_IN_ORIGINAL_PLACE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!cust_closers && RUNNING_IN_ORIGINAL_PLACE) {
|
||||||
if (replacement_at_exit) {
|
if (replacement_at_exit) {
|
||||||
replacement_at_exit(do_run_atexit_closers_on_all);
|
replacement_at_exit(do_run_atexit_closers_on_all);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user