changeset 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 443fc7d6fbff
children 35e652831230
files ChangeLog src/account.c
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Oct 24 15:37:17 2003 +0000
+++ b/ChangeLog	Fri Oct 24 22:01:58 2003 +0000
@@ -4,6 +4,10 @@
 	* Added a search feature to conversations.
 	* Fixed a crash in the Add Chat dialog when selecting an
 	  account that doesn't support chats. Closes bug #821606.
+	* Fixed a bug where new MSN accounts without buddies added wouldn't
+	  connect.
+	* Fixed a crash when deleting an account that has IMs or chats open.
+	  Closes bug #821630.
 	* If SSL is not enabled, MSN will load, but error on connect.
 	* Disable Jabber SASL auth until the standard stabilizes
 	* Czech translation updated (Stanislav Brabec, Miloslav Trmac)
--- 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);