summaryrefslogtreecommitdiff
path: root/src/plugins/javascript/weechat-js.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-12-15 22:53:51 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-12-15 22:53:51 +0100
commit75dc8b9d6c2c2f816ecbeffa4d4b048ebc2d5f58 (patch)
tree0ef749137348dca1ee0acd2fdd07184b2cf835f8 /src/plugins/javascript/weechat-js.cpp
parent07fbd309487b7de977e5798e67e70de1bd2fed8a (diff)
downloadweechat-75dc8b9d6c2c2f816ecbeffa4d4b048ebc2d5f58.zip
core: fix crash on plugin reload when using musl libs (closes #2052)
Diffstat (limited to 'src/plugins/javascript/weechat-js.cpp')
-rw-r--r--src/plugins/javascript/weechat-js.cpp14
1 files changed, 14 insertions, 0 deletions
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;