1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

Fixed crash when unloading/reloading scripts using modifiers

This commit is contained in:
Sebastien Helleu
2006-10-25 07:38:56 +00:00
parent 81aff59e4e
commit e9939cf574
2 changed files with 30 additions and 0 deletions
+15
View File
@@ -235,6 +235,7 @@ weechat_script_remove (t_weechat_plugin *plugin,
t_plugin_script **script_list, t_plugin_script *script)
{
t_plugin_handler *ptr_handler, *next_handler;
t_plugin_modifier *ptr_modifier, *next_modifier;
/* remove all handlers pointing to script */
ptr_handler = plugin->handlers;
@@ -250,6 +251,20 @@ weechat_script_remove (t_weechat_plugin *plugin,
ptr_handler = ptr_handler->next_handler;
}
/* remove all modifiers pointing to script */
ptr_modifier = plugin->modifiers;
while (ptr_modifier)
{
if ((t_plugin_script *)ptr_modifier->modifier_pointer == script)
{
next_modifier = ptr_modifier->next_modifier;
plugin->modifier_remove (plugin, ptr_modifier);
ptr_modifier = next_modifier;
}
else
ptr_modifier = ptr_modifier->next_modifier;
}
/* free data */
if (script->filename)
free (script->filename);