diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-11-22 12:29:42 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-11-22 12:29:42 +0100 |
commit | af49ee7f30c881dbde75445b825093cb40cd2899 (patch) | |
tree | 7e557b38f7f744c8246f64105023e188070aeb14 /src/plugins | |
parent | d2cf981fd94058334284d3e0e25290de926c8771 (diff) | |
download | weechat-af49ee7f30c881dbde75445b825093cb40cd2899.zip |
Fix crash when purging dcc chat if 2 dcc chat have same buffer (bug #28071)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/xfer/xfer.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c index 612e53646..5cadb2a58 100644 --- a/src/plugins/xfer/xfer.c +++ b/src/plugins/xfer/xfer.c @@ -630,13 +630,22 @@ xfer_new (const char *plugin_name, const char *plugin_id, void xfer_free (struct t_xfer *xfer) { - struct t_xfer *new_xfer_list; + struct t_xfer *new_xfer_list, *ptr_xfer; + struct t_gui_buffer *ptr_buffer; if (!xfer) return; if (xfer->buffer) - weechat_buffer_close (xfer->buffer); + { + ptr_buffer = xfer->buffer; + for (ptr_xfer = xfer_list; ptr_xfer; ptr_xfer = ptr_xfer->next_xfer) + { + if (ptr_xfer->buffer == ptr_buffer) + ptr_xfer->buffer = NULL; + } + weechat_buffer_close (ptr_buffer); + } /* remove xfer from list */ if (last_xfer == xfer) |