Mercurial > pidgin.yaz
diff src/account.c @ 7324:4963abdebd29
[gaim-migrate @ 7910]
Fixed a crash when deleting an account that has IMs or chats open. Closes
bug #821630.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Fri, 24 Oct 2003 22:01:58 +0000 |
parents | 412163e23000 |
children | c57206d8753f |
line wrap: on
line diff
--- a/src/account.c Fri Oct 24 15:37:17 2003 +0000 +++ b/src/account.c Fri Oct 24 22:01:58 2003 +0000 @@ -153,6 +153,8 @@ void gaim_account_destroy(GaimAccount *account) { + GList *l; + g_return_if_fail(account != NULL); gaim_debug(GAIM_DEBUG_INFO, "account", @@ -164,6 +166,14 @@ 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); if (account->password != NULL) g_free(account->password);