1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

core: fix crash on plugin reload when using musl libs (closes #2052)

This commit is contained in:
Sébastien Helleu
2023-12-15 22:53:51 +01:00
parent 07fbd30948
commit 75dc8b9d6c
43 changed files with 320 additions and 5 deletions
+1
View File
@@ -218,4 +218,5 @@ void
typing_config_free ()
{
weechat_config_free (typing_config_file);
typing_config_file = NULL;
}
+41
View File
@@ -580,6 +580,45 @@ typing_setup_hooks ()
}
}
/*
* Removes all hooks.
*/
void
typing_remove_hooks ()
{
if (typing_signal_buffer_closing)
{
weechat_unhook (typing_signal_buffer_closing);
typing_signal_buffer_closing = NULL;
}
if (typing_signal_input_text_changed)
{
weechat_unhook (typing_signal_input_text_changed);
typing_signal_input_text_changed = NULL;
}
if (typing_modifier_input_text_for_buffer)
{
weechat_unhook (typing_modifier_input_text_for_buffer);
typing_modifier_input_text_for_buffer = NULL;
}
if (typing_timer)
{
weechat_unhook (typing_timer);
typing_timer = NULL;
}
if (typing_signal_typing_set_nick)
{
weechat_unhook (typing_signal_typing_set_nick);
typing_signal_typing_set_nick = NULL;
}
if (typing_signal_typing_reset_buffer)
{
weechat_unhook (typing_signal_typing_reset_buffer);
typing_signal_typing_reset_buffer = NULL;
}
}
/*
* Initializes typing plugin.
*/
@@ -615,6 +654,8 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
/* make C compiler happy */
(void) plugin;
typing_remove_hooks ();
typing_config_write ();
typing_config_free ();