From 75dc8b9d6c2c2f816ecbeffa4d4b048ebc2d5f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 15 Dec 2023 22:53:51 +0100 Subject: core: fix crash on plugin reload when using musl libs (closes #2052) --- src/plugins/javascript/weechat-js.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/plugins/javascript/weechat-js.cpp') diff --git a/src/plugins/javascript/weechat-js.cpp b/src/plugins/javascript/weechat-js.cpp index 446586396..2a8780310 100644 --- a/src/plugins/javascript/weechat-js.cpp +++ b/src/plugins/javascript/weechat-js.cpp @@ -930,6 +930,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) weechat_js_plugin = plugin; + js_quiet = 0; + js_eval_mode = 0; + js_eval_send_input = 0; + js_eval_exec_commands = 0; + /* set interpreter name and version */ snprintf (str_interpreter, sizeof (str_interpreter), "%s (v8)", plugin->name); @@ -980,11 +985,20 @@ weechat_plugin_end (struct t_weechat_plugin *plugin) /* free some data */ if (js_action_install_list) + { free (js_action_install_list); + js_action_install_list = NULL; + } if (js_action_remove_list) + { free (js_action_remove_list); + js_action_remove_list = NULL; + } if (js_action_autoload_list) + { free (js_action_autoload_list); + js_action_autoload_list = NULL; + } /* weechat_string_dyn_free (js_buffer_output, 1); */ return WEECHAT_RC_OK; -- cgit v1.2.3