diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-14 14:17:12 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-14 14:17:12 +0200 |
commit | d33679e4ffd9f36f14f677553b56f9b8ad72dd0d (patch) | |
tree | 292d1db7a0895a7d0b4442f5cc214852b0f8f5df /protocols/bee.c | |
parent | 21c87a78f1c01fe24610a5d05a65e52bd8eaa796 (diff) |
Call bee_free() from irc_free() or daemon mode gets pretty sad.
Diffstat (limited to 'protocols/bee.c')
-rw-r--r-- | protocols/bee.c | 18 |
1 files changed, 8 insertions, 10 deletions
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 ) |