diff --git a/src/gig_callback.c b/src/gig_callback.c index 4e08fe9c..42e11046 100644 --- a/src/gig_callback.c +++ b/src/gig_callback.c @@ -180,6 +180,10 @@ callback_binding(ffi_cif *cif, gpointer ret, gpointer *ffi_args, gpointer user_d SCM s_args = SCM_EOL; SCM s_ret; + // When using GLib thread functions, this could be the entrypoint + // into Guile for this thread. + scm_init_guile(); + g_assert(cif != NULL); g_assert(ret != NULL); g_assert(ffi_args != NULL); diff --git a/src/gig_function.c b/src/gig_function.c index e3960e30..0cc4bdd0 100644 --- a/src/gig_function.c +++ b/src/gig_function.c @@ -1,4 +1,4 @@ -// Copyright (C) 2018, 2019, 2020 Michael L. Gran +// Copyright (C) 2018, 2019, 2020, 2021 Michael L. Gran // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -626,6 +626,10 @@ function_binding(ffi_cif *cif, gpointer ret, gpointer *ffi_args, gpointer user_d GObject *self = NULL; SCM s_args = SCM_UNDEFINED; + // When using GLib thread functions, could this be the entrypoint + // into Guile for this thread? + scm_init_guile(); + g_assert(cif != NULL); g_assert(ret != NULL); g_assert(ffi_args != NULL);