aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@google.com>2010-12-02 12:14:09 +0000
committerWilmer van der Gaast <wilmer@google.com>2010-12-02 12:14:09 +0000
commitcc20520bd29c88d424f44ac5669c3026e9fd99fb (patch)
treea11bdacd994046ce25a4e654c3d88a22724530a8
parentb11b781cc66fa7ffeaa96e7a21b9d5b528d2c4a4 (diff)
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.
-rw-r--r--irc_channel.c2
-rw-r--r--irc_im.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/irc_channel.c b/irc_channel.c
index 15b1744a..03fe93e9 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -142,6 +142,8 @@ int irc_channel_free( irc_channel_t *ic )
iu->last_channel = irc->default_channel;
}
+ if( ic->pastebuf_timer ) b_event_remove( ic->pastebuf_timer );
+
g_free( ic->name );
g_free( ic->topic );
g_free( ic->topic_who );
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;
}