summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-06-27 21:44:54 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-06-27 21:45:15 +0200
commitb52047c69e34744f6b057edf0ee794143105f628 (patch)
treef45173070f02db1c7a21b54f405dd6223b8b88eb
parentb551d6f247a4234ea425cc23eb9d57ea61f7d179 (diff)
downloadweechat-b52047c69e34744f6b057edf0ee794143105f628.zip
guile: fix crash on quit with Guile < 3 (issue #1965)
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/plugins/guile/weechat-guile.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 5146f6cd6..cd0ae68f0 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -25,6 +25,7 @@ Bug fixes::
* core: display actual key name and command with key kbd:[Alt+k], remove key kbd:[Alt+K] (grab raw key) and associated commands `/input grab_raw_key` and `/input grab_raw_key_command`
* core: check for newline characters in string_is_whitespace_char (issue #1968)
* api: do not convert option name to lower case in API functions config_set_plugin and config_set_desc_plugin
+ * guile: fix crash on quit with Guile < 3 (issue #1965)
* irc: reply to a CTCP request sent to self nick (issue #1966)
* irc: sent "QUIT" message to servers connected with TLS on `/upgrade`
* irc: fix display of country code in message 344 received as whois geo info (issue #1736)
diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c
index b7b05d456..ce9cd4d87 100644
--- a/src/plugins/guile/weechat-guile.c
+++ b/src/plugins/guile/weechat-guile.c
@@ -1289,7 +1289,16 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
scm_install_gmp_memory_functions = 0;
#endif /* defined(HAVE_GUILE_GMP_MEMORY_FUNCTIONS) && (SCM_MAJOR_VERSION < 3 || (SCM_MAJOR_VERSION == 3 && SCM_MINOR_VERSION == 0 && SCM_MICRO_VERSION < 8)) */
+#if defined(__MACH__) || SCM_MAJOR_VERSION < 3
+ /*
+ * on GNU/Hurd or if using Guile < 3, use scm_with_guile() instead of
+ * scm_init_guile() to prevent crash on exit
+ */
scm_with_guile (&weechat_guile_init, NULL);
+#else
+ /* any other OS (not GNU/Hurd) or Guile >= 3.x */
+ scm_init_guile ();
+#endif
guile_module_weechat = scm_c_define_module ("weechat",
&weechat_guile_api_module_init,