From: Christian H. <ch...@us...> - 2003-10-24 23:03:16
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv13559/src Modified Files: account.c Log Message: Fixed a crash when deleting an account that has IMs or chats open. Closes bug #821630. Index: account.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/account.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -p -r1.70 -r1.71 --- account.c 14 Oct 2003 17:12:01 -0000 1.70 +++ account.c 24 Oct 2003 22:01:58 -0000 1.71 @@ -153,6 +153,8 @@ gaim_account_new(const char *username, c void gaim_account_destroy(GaimAccount *account) { + GList *l; + g_return_if_fail(account != NULL); gaim_debug(GAIM_DEBUG_INFO, "account", @@ -163,6 +165,14 @@ gaim_account_destroy(GaimAccount *accoun gaim_debug(GAIM_DEBUG_INFO, "account", "Continuing to destroy account %p\n", account); + + for (l = gaim_get_conversations(); l != NULL; l = l->next) + { + GaimConversation *conv = (GaimConversation *)l->data; + + if (gaim_conversation_get_account(conv) == account) + gaim_conversation_set_account(conv, NULL); + } if (account->username != NULL) g_free(account->username); if (account->alias != NULL) g_free(account->alias); |