aboutsummaryrefslogtreecommitdiffstats
path: root/account.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-04-02 00:07:21 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2008-04-02 00:07:21 +0100
commitfa75134008bd9206ca02380927c27581feb65c3e (patch)
tree90ec0ea3f4d618629e75b2eb62afa98b0a96372e /account.c
parentddba0aea68f90b06bb6278cada982eb88889c31c (diff)
Reordered irc_free() a little bit, hoping that this will fix a crash-on-quit
bug I can't figure out. The previous order wasn't optimal.
Diffstat (limited to 'account.c')
-rw-r--r--account.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/account.c b/account.c
index 4eb78faa..2c6e1069 100644
--- a/account.c
+++ b/account.c
@@ -181,19 +181,17 @@ void account_del( irc_t *irc, account_t *acc )
{
account_t *a, *l = NULL;
+ if( acc->ic )
+ /* Caller should have checked, accounts still in use can't be deleted. */
+ return;
+
for( a = irc->accounts; a; a = (l=a)->next )
if( a == acc )
{
- if( a->ic ) return; /* Caller should have checked, accounts still in use can't be deleted. */
-
if( l )
- {
l->next = a->next;
- }
else
- {
irc->accounts = a->next;
- }
while( a->set )
set_del( &a->set, a->set->key );
@@ -202,7 +200,7 @@ void account_del( irc_t *irc, account_t *acc )
g_free( a->user );
g_free( a->pass );
- if( a->server ) g_free( a->server );
+ g_free( a->server );
if( a->reconnect ) /* This prevents any reconnect still queued to happen */
cancel_auto_reconnect( a );
g_free( a );