diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-02-04 13:57:35 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-02-04 13:57:35 +0100 |
commit | 162dc87796abe6b36ef0290f5f94ead7f45fd5a4 (patch) | |
tree | 53755adceb421b459bbffbd326272f8d4bb33f78 | |
parent | 7f2f60dab0bc25cc45ddc69e957a2eb8b2ebb3f5 (diff) | |
download | weechat-162dc87796abe6b36ef0290f5f94ead7f45fd5a4.zip |
scripts: fix crash on script unload when a hook is created in a buffer close callback (closes #2067)
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | src/plugins/plugin-script.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 198aa428f..51a6b8eb6 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -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) diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c index 3ad8aec19..70c60c3ad 100644 --- a/src/plugins/plugin-script.c +++ b/src/plugins/plugin-script.c @@ -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; |