summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-11-22 12:29:42 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-11-22 12:29:42 +0100
commitaf49ee7f30c881dbde75445b825093cb40cd2899 (patch)
tree7e557b38f7f744c8246f64105023e188070aeb14 /src/plugins
parentd2cf981fd94058334284d3e0e25290de926c8771 (diff)
downloadweechat-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.c13
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)