diff options
author | Sven Moritz Hallberg <pesco@khjk.org> | 2010-09-19 20:19:31 +0200 |
---|---|---|
committer | Sven Moritz Hallberg <pesco@khjk.org> | 2010-09-19 20:19:31 +0200 |
commit | 51e9a1dd00c43a18ab9121e27c2631fd02de0188 (patch) | |
tree | 1a54d64868f587c6881f1ab6367b12cab0f61315 | |
parent | 76e2f624b3adee07d6ea970961411d8a7c734745 (diff) |
call storage_save before freeing plugins, avoids segfault in otr.c
-rw-r--r-- | irc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 ) |