summaryrefslogtreecommitdiff
path: root/src/plugins/plugin.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-04-30 13:21:21 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-04-30 13:21:21 +0200
commit886b81498f2b0e738c16ec55d4675f3c8555117d (patch)
tree5faa27240b105ce0c0f67c4a40fc1ee17fc40cfe /src/plugins/plugin.c
parent760e216c5b3cc7945bfb17f94e39900d20c185e7 (diff)
downloadweechat-886b81498f2b0e738c16ec55d4675f3c8555117d.zip
Fixed crash with scripts when WeeChat calls functions of many scripts at same time with callbacks (bug #23109)
Diffstat (limited to 'src/plugins/plugin.c')
-rw-r--r--src/plugins/plugin.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index b033c552a..913d06532 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -562,18 +562,22 @@ void
plugin_remove (struct t_weechat_plugin *plugin)
{
struct t_weechat_plugin *new_weechat_plugins;
- struct t_gui_buffer *ptr_buffer;
+ struct t_gui_buffer *ptr_buffer, *next_buffer;
/* close buffers created by this plugin */
- for (ptr_buffer = gui_buffers; ptr_buffer;
- ptr_buffer = ptr_buffer->next_buffer)
+ ptr_buffer = gui_buffers;
+ while (ptr_buffer)
{
+ next_buffer = ptr_buffer->next_buffer;
+
if (ptr_buffer->plugin == plugin)
{
ptr_buffer->close_callback = NULL;
ptr_buffer->close_callback_data = NULL;
gui_buffer_close (ptr_buffer, 1);
}
+
+ ptr_buffer = next_buffer;
}
/* remove plugin from list */