diff --git a/libguile/gc.c b/libguile/gc.c index abdfffc32..48944de73 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -41,6 +41,7 @@ #include "gsubr.h" #include "hashtab.h" #include "hooks.h" +#include "init.h" #include "list.h" #include "modules.h" #include "numbers.h" @@ -194,7 +195,8 @@ scm_gc_event_listener_restarting_mutators (void *data) /* If there are Scheme hooks and we have a current Guile thread, enqueue those to be run on the current thread. */ scm_thread *t = SCM_I_CURRENT_THREAD; - if (t && scm_is_false (SCM_CDR (after_gc_async_cell)) && + if (t && scm_initialized_p && + scm_is_false (SCM_CDR (after_gc_async_cell)) && scm_is_false (scm_hook_empty_p (scm_after_gc_hook))) { SCM_SETCDR (after_gc_async_cell, t->pending_asyncs);