1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 22:06:38 +02:00

Fixed crashes with DCC chat remove/purge on DCC view (bug #16775)

This commit is contained in:
Sebastien Helleu
2006-06-10 16:42:22 +00:00
parent 59795445c5
commit cb329a3f33
14 changed files with 54 additions and 12 deletions
+3
View File
@@ -95,6 +95,9 @@ channel_free (t_irc_server *server, t_irc_channel *channel)
{
t_irc_channel *new_channels;
if (!server || !channel)
return;
/* close DCC CHAT */
if ((t_irc_dcc *)(channel->dcc_chat) &&
(!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status)))
+5 -1
View File
@@ -345,6 +345,9 @@ dcc_free (t_irc_dcc *ptr_dcc)
{
t_irc_dcc *new_dcc_list;
if (!ptr_dcc)
return;
/* DCC CHAT with channel => remove channel
(to prevent channel from becoming standard pv) */
if (ptr_dcc->channel)
@@ -354,7 +357,8 @@ dcc_free (t_irc_dcc *ptr_dcc)
|| (DCC_ENDED(((t_irc_dcc *)(ptr_dcc->channel->dcc_chat))->status)))
{
gui_buffer_free (ptr_dcc->channel->buffer, 1);
channel_free (ptr_dcc->server, ptr_dcc->channel);
if (ptr_dcc->channel)
channel_free (ptr_dcc->server, ptr_dcc->channel);
}
}
+7 -1
View File
@@ -267,7 +267,10 @@ void
nick_free (t_irc_channel *channel, t_irc_nick *nick)
{
t_irc_nick *new_nicks;
if (!channel || !nick)
return;
/* remove nick from queue */
if (channel->last_nick == nick)
channel->last_nick = nick->prev_nick;
@@ -300,6 +303,9 @@ nick_free (t_irc_channel *channel, t_irc_nick *nick)
void
nick_free_all (t_irc_channel *channel)
{
if (!channel)
return;
/* remove all nicks for the channel */
while (channel->nicks)
nick_free (channel, channel->nicks);
+6
View File
@@ -283,6 +283,9 @@ server_alloc ()
void
server_destroy (t_irc_server *server)
{
if (!server)
return;
/* free data */
if (server->name)
free (server->name);
@@ -333,6 +336,9 @@ server_free (t_irc_server *server)
{
t_irc_server *new_irc_servers;
if (!server)
return;
/* close any opened channel/private */
while (server->channels)
channel_free (server, server->channels);