1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 07:16:37 +02:00

Fixed bug #16416 (crash when purging old DCC chats)

This commit is contained in:
Sebastien Helleu
2006-04-23 08:19:06 +00:00
parent bcee678a56
commit 6021ee85cb
6 changed files with 48 additions and 0 deletions
+4
View File
@@ -435,6 +435,10 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
if (buffer->type == BUFFER_TYPE_RAW_DATA)
gui_buffer_raw_data = NULL;
/* purge DCC chat using this buffer */
if (CHANNEL(buffer))
dcc_chat_remove_channel (CHANNEL(buffer));
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
+19
View File
@@ -509,6 +509,25 @@ dcc_channel_for_chat (t_irc_dcc *ptr_dcc)
GUI_COLOR(COLOR_WIN_CHAT));
}
/*
* dcc_chat_remove_channel: remove a buffer for DCC chat
*/
void
dcc_chat_remove_channel (t_irc_channel *channel)
{
t_irc_dcc *ptr_dcc;
if (!channel)
return;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if (ptr_dcc->channel == channel)
ptr_dcc->channel = NULL;
}
}
/*
* dcc_recv_connect_init: connect to sender and init file or chat
*/
+1
View File
@@ -406,6 +406,7 @@ extern void nick_print_log (t_irc_nick *);
extern void dcc_redraw (int);
extern void dcc_free (t_irc_dcc *);
extern void dcc_close (t_irc_dcc *, int);
extern void dcc_chat_remove_channel (t_irc_channel *);
extern void dcc_accept (t_irc_dcc *);
extern void dcc_accept_resume (t_irc_server *, char *, int, unsigned long);
extern void dcc_start_resume (t_irc_server *, char *, int, unsigned long);
+4
View File
@@ -435,6 +435,10 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
if (buffer->type == BUFFER_TYPE_RAW_DATA)
gui_buffer_raw_data = NULL;
/* purge DCC chat using this buffer */
if (CHANNEL(buffer))
dcc_chat_remove_channel (CHANNEL(buffer));
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
+19
View File
@@ -509,6 +509,25 @@ dcc_channel_for_chat (t_irc_dcc *ptr_dcc)
GUI_COLOR(COLOR_WIN_CHAT));
}
/*
* dcc_chat_remove_channel: remove a buffer for DCC chat
*/
void
dcc_chat_remove_channel (t_irc_channel *channel)
{
t_irc_dcc *ptr_dcc;
if (!channel)
return;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if (ptr_dcc->channel == channel)
ptr_dcc->channel = NULL;
}
}
/*
* dcc_recv_connect_init: connect to sender and init file or chat
*/
+1
View File
@@ -406,6 +406,7 @@ extern void nick_print_log (t_irc_nick *);
extern void dcc_redraw (int);
extern void dcc_free (t_irc_dcc *);
extern void dcc_close (t_irc_dcc *, int);
extern void dcc_chat_remove_channel (t_irc_channel *);
extern void dcc_accept (t_irc_dcc *);
extern void dcc_accept_resume (t_irc_server *, char *, int, unsigned long);
extern void dcc_start_resume (t_irc_server *, char *, int, unsigned long);