summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/scripts/script.c')
-rw-r--r--src/plugins/scripts/script.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c
index 242132e7a..fb28a46b5 100644
--- a/src/plugins/scripts/script.c
+++ b/src/plugins/scripts/script.c
@@ -416,10 +416,12 @@ script_remove (struct t_weechat_plugin *weechat_plugin,
for (ptr_script_callback = script->callbacks; ptr_script_callback;
ptr_script_callback = ptr_script_callback->next_callback)
{
+ /* unhook */
if (ptr_script_callback->hook)
{
weechat_unhook (ptr_script_callback->hook);
}
+ /* free config file */
if (ptr_script_callback->config_file
&& !ptr_script_callback->config_section
&& !ptr_script_callback->config_option)
@@ -428,6 +430,9 @@ script_remove (struct t_weechat_plugin *weechat_plugin,
weechat_config_write (ptr_script_callback->config_file);
weechat_config_free (ptr_script_callback->config_file);
}
+ /* remove bar item */
+ if (ptr_script_callback->bar_item)
+ weechat_bar_item_remove (ptr_script_callback->bar_item);
}
/* remove all callbacks created by this script */