From cc20520bd29c88d424f44ac5669c3026e9fd99fb Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 2 Dec 2010 12:14:09 +0000 Subject: Clean up pastebuf_timer when cleaning up channels, and properly clean up channel-chatroom reference when leaving a chatroom. This fixes two very similar crash bugs when leaving a chatroom within the paste_buffer_delay period. --- irc_im.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'irc_im.c') diff --git a/irc_im.c b/irc_im.c index eb8d01f2..40264b49 100644 --- a/irc_im.c +++ b/irc_im.c @@ -793,7 +793,8 @@ static gboolean bee_irc_channel_chat_privmsg_cb( gpointer data, gint fd, b_input { irc_channel_t *ic = data; - bee_chat_msg( ic->irc->b, ic->data, ic->pastebuf->str, 0 ); + if( ic->data ) + bee_chat_msg( ic->irc->b, ic->data, ic->pastebuf->str, 0 ); g_string_free( ic->pastebuf, TRUE ); ic->pastebuf = 0; @@ -840,6 +841,8 @@ static gboolean bee_irc_channel_chat_part( irc_channel_t *ic, const char *msg ) if( c && c->ic->acc->prpl->chat_leave ) c->ic->acc->prpl->chat_leave( c ); + ic->data = NULL; + return TRUE; } -- cgit v1.2.3