aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Moritz Hallberg <pesco@khjk.org>2010-09-19 20:19:31 +0200
committerSven Moritz Hallberg <pesco@khjk.org>2010-09-19 20:19:31 +0200
commit51e9a1dd00c43a18ab9121e27c2631fd02de0188 (patch)
tree1a54d64868f587c6881f1ab6367b12cab0f61315
parent76e2f624b3adee07d6ea970961411d8a7c734745 (diff)
call storage_save before freeing plugins, avoids segfault in otr.c
-rw-r--r--irc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/irc.c b/irc.c
index ed705caa..bc44c6e3 100644
--- a/irc.c
+++ b/irc.c
@@ -221,6 +221,10 @@ void irc_free( irc_t * irc )
log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd );
+ if( irc->status & USTATUS_IDENTIFIED && set_getbool( &irc->b->set, "save_on_quit" ) )
+ if( storage_save( irc, NULL, TRUE ) != STORAGE_OK )
+ log_message( LOGLVL_WARNING, "Error while saving settings for user %s", irc->user->nick );
+
for( l = irc_plugins; l; l = l->next )
{
irc_plugin_t *p = l->data;
@@ -228,10 +232,6 @@ void irc_free( irc_t * irc )
p->irc_free( irc );
}
- if( irc->status & USTATUS_IDENTIFIED && set_getbool( &irc->b->set, "save_on_quit" ) )
- if( storage_save( irc, NULL, TRUE ) != STORAGE_OK )
- log_message( LOGLVL_WARNING, "Error while saving settings for user %s", irc->user->nick );
-
irc_connection_list = g_slist_remove( irc_connection_list, irc );
while( irc->queries != NULL )