From d33679e4ffd9f36f14f677553b56f9b8ad72dd0d Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 14 Apr 2010 14:17:12 +0200 Subject: Call bee_free() from irc_free() or daemon mode gets pretty sad. --- protocols/bee.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'protocols/bee.c') diff --git a/protocols/bee.c b/protocols/bee.c index 1aaa90f0..de9550c2 100644 --- a/protocols/bee.c +++ b/protocols/bee.c @@ -51,21 +51,19 @@ bee_t *bee_new() void bee_free( bee_t *b ) { - account_t *acc = b->accounts; - - while( acc ) + while( b->accounts ) { - if( acc->ic ) - imc_logout( acc->ic, FALSE ); - else if( acc->reconnect ) - cancel_auto_reconnect( acc ); + if( b->accounts->ic ) + imc_logout( b->accounts->ic, FALSE ); + else if( b->accounts->reconnect ) + cancel_auto_reconnect( b->accounts ); - if( acc->ic == NULL ) - account_del( b, acc ); + if( b->accounts->ic == NULL ) + account_del( b, b->accounts ); else /* Nasty hack, but account_del() doesn't work in this case and we don't want infinite loops, do we? ;-) */ - acc = acc->next; + b->accounts = b->accounts->next; } while( b->set ) -- cgit v1.2.3