summaryrefslogtreecommitdiff
path: root/src/plugins/script/script.c
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/script/script.c
parent07fbd309487b7de977e5798e67e70de1bd2fed8a (diff)
downloadweechat-75dc8b9d6c2c2f816ecbeffa4d4b048ebc2d5f58.zip
core: fix crash on plugin reload when using musl libs (closes #2052)
Diffstat (limited to 'src/plugins/script/script.c')
-rw-r--r--src/plugins/script/script.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/plugins/script/script.c b/src/plugins/script/script.c
index f04ccb248..7679e9806 100644
--- a/src/plugins/script/script.c
+++ b/src/plugins/script/script.c
@@ -386,6 +386,27 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
/* make C compiler happy */
(void) plugin;
+ if (script_loaded)
+ {
+ weechat_hashtable_free (script_loaded);
+ script_loaded = NULL;
+ }
+ if (script_timer_refresh)
+ {
+ weechat_unhook (script_timer_refresh);
+ script_timer_refresh = NULL;
+ }
+
+ if (script_buffer)
+ {
+ weechat_buffer_close (script_buffer);
+ script_buffer = NULL;
+ }
+ script_buffer_selected_line = 0;
+ script_buffer_detail_script = NULL;
+ script_buffer_detail_script_last_line = 0;
+ script_buffer_detail_script_line_diff = -1;
+
script_mouse_end ();
script_config_write ();
@@ -393,10 +414,16 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
script_repo_remove_all ();
if (script_repo_filter)
+ {
free (script_repo_filter);
+ script_repo_filter = NULL;
+ }
if (script_loaded)
+ {
weechat_hashtable_free (script_loaded);
+ script_loaded = NULL;
+ }
script_config_free ();