summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-11-21 20:57:49 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-11-21 20:57:49 +0100
commit2b0c2747ade0b65c4d2bdeee2ee80c1529edb633 (patch)
treee34b060acf58627403a381eeb209b52d50eb2e5b /src
parent6b0b3996cd19eb45843dd3f255c9d97bb4bfacd5 (diff)
downloadweechat-2b0c2747ade0b65c4d2bdeee2ee80c1529edb633.zip
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 22602147977b42f4211697d77263be67c9506414.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/plugin-script.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c
index 5737950f3..f6a538aaf 100644
--- a/src/plugins/plugin-script.c
+++ b/src/plugins/plugin-script.c
@@ -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;