aboutsummaryrefslogtreecommitdiffstats
path: root/irc.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-02-18 17:19:01 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2007-02-18 17:19:01 +0000
commitf959495182db79b0c3b51c6bc4e9fcacdc591c40 (patch)
treedde0690b557cf9d99fec00fab88c898e530c3881 /irc.c
parent7e0af5345f398a439459ac1752b8a946fb53a87e (diff)
Preventing infinite loop while cleaning up accounts in irc_free(). Closes #245.
Diffstat (limited to 'irc.c')
-rw-r--r--irc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/irc.c b/irc.c
index f9654034..eb4a395d 100644
--- a/irc.c
+++ b/irc.c
@@ -255,7 +255,12 @@ void irc_free(irc_t * irc)
query_del(irc, irc->queries);
while (irc->accounts)
- account_del(irc, irc->accounts);
+ if (irc->accounts->gc == NULL)
+ account_del(irc, irc->accounts);
+ else
+ /* Nasty hack, but account_del() doesn't work in this
+ case and we don't want infinite loops, do we? ;-) */
+ irc->accounts = irc->accounts->next;
while (irc->set)
set_del(&irc->set, irc->set->key);