summaryrefslogtreecommitdiff
path: root/src/plugins/fset
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/fset
parent07fbd309487b7de977e5798e67e70de1bd2fed8a (diff)
downloadweechat-75dc8b9d6c2c2f816ecbeffa4d4b048ebc2d5f58.zip
core: fix crash on plugin reload when using musl libs (closes #2052)
Diffstat (limited to 'src/plugins/fset')
-rw-r--r--src/plugins/fset/fset-bar-item.c1
-rw-r--r--src/plugins/fset/fset-buffer.c20
-rw-r--r--src/plugins/fset/fset-config.c1
-rw-r--r--src/plugins/fset/fset-option.c5
4 files changed, 23 insertions, 4 deletions
diff --git a/src/plugins/fset/fset-bar-item.c b/src/plugins/fset/fset-bar-item.c
index feaf1fc7f..5ecc89de3 100644
--- a/src/plugins/fset/fset-bar-item.c
+++ b/src/plugins/fset/fset-bar-item.c
@@ -248,4 +248,5 @@ void
fset_bar_item_end ()
{
weechat_bar_item_remove (fset_bar_item_fset);
+ fset_bar_item_fset = NULL;
}
diff --git a/src/plugins/fset/fset-buffer.c b/src/plugins/fset/fset-buffer.c
index c7a69ae54..4684973d7 100644
--- a/src/plugins/fset/fset-buffer.c
+++ b/src/plugins/fset/fset-buffer.c
@@ -1654,9 +1654,21 @@ fset_buffer_init ()
void
fset_buffer_end ()
{
- weechat_hashtable_free (fset_buffer_hashtable_pointers);
- fset_buffer_hashtable_pointers = NULL;
+ if (fset_buffer)
+ {
+ weechat_buffer_close (fset_buffer);
+ fset_buffer = NULL;
+ }
- weechat_hashtable_free (fset_buffer_hashtable_extra_vars);
- fset_buffer_hashtable_extra_vars = NULL;
+ if (fset_buffer_hashtable_pointers)
+ {
+ weechat_hashtable_free (fset_buffer_hashtable_pointers);
+ fset_buffer_hashtable_pointers = NULL;
+ }
+
+ if (fset_buffer_hashtable_extra_vars)
+ {
+ weechat_hashtable_free (fset_buffer_hashtable_extra_vars);
+ fset_buffer_hashtable_extra_vars = NULL;
+ }
}
diff --git a/src/plugins/fset/fset-config.c b/src/plugins/fset/fset-config.c
index 886a403c9..85c0e00cc 100644
--- a/src/plugins/fset/fset-config.c
+++ b/src/plugins/fset/fset-config.c
@@ -1186,6 +1186,7 @@ void
fset_config_free ()
{
weechat_config_free (fset_config_file);
+ fset_config_file = NULL;
if (fset_config_auto_refresh)
{
diff --git a/src/plugins/fset/fset-option.c b/src/plugins/fset/fset-option.c
index b478569d3..1a2020c1f 100644
--- a/src/plugins/fset/fset-option.c
+++ b/src/plugins/fset/fset-option.c
@@ -1934,4 +1934,9 @@ fset_option_end ()
weechat_hashtable_free (fset_option_timer_options_changed);
fset_option_timer_options_changed = NULL;
}
+ if (fset_option_timer_hook)
+ {
+ weechat_unhook (fset_option_timer_hook);
+ fset_option_timer_hook = NULL;
+ }
}