1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

api: remove script hooks before buffers/bar items/configs

This prevents a crash in some scripts that could use options after they are
freed, with the call to hook config callback that has been enabled by commit
2260214797.
This commit is contained in:
Sébastien Helleu
2023-11-21 20:57:49 +01:00
parent 6b0b3996cd
commit 2b0c2747ad
+3 -3
View File
@@ -1054,15 +1054,15 @@ plugin_script_remove (struct t_weechat_plugin *weechat_plugin,
{
script->unloading = 1;
/* remove all hooks created by this script */
weechat_unhook_all (script->name);
plugin_script_close_buffers (weechat_plugin, script);
plugin_script_remove_bar_items (weechat_plugin, script);
plugin_script_remove_configs (weechat_plugin, script);
/* remove all hooks created by this script */
weechat_unhook_all (script->name);
/* remove script from list */
if (script->prev_script)
(script->prev_script)->next_script = script->next_script;