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

scripts: fix crash on script unload when a hook is created in a buffer close callback (closes #2067)

This commit is contained in:
Sébastien Helleu
2024-02-04 13:57:35 +01:00
parent 7f2f60dab0
commit 162dc87796
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -25,6 +25,7 @@ New features::
Bug fixes::
* irc: fix random date displayed when a received message contains tags but no "time" (issue #2064)
* scripts: fix crash on script unload when a hook is created in a buffer close callback (issue #2067)
[[v4.2.1]]
== Version 4.2.1 (2024-01-22)
+6
View File
@@ -1063,6 +1063,12 @@ plugin_script_remove (struct t_weechat_plugin *weechat_plugin,
plugin_script_remove_configs (weechat_plugin, script);
/*
* remove again all hooks created by this script (just in case new hooks
* were created by the calls above)
*/
weechat_unhook_all (script->name);
/* remove script from list */
if (script->prev_script)
(script->prev_script)->next_script = script->next_script;