comparison libpurple/account.c @ 18452:45865fb3f4f9

Do not crash if you delete an account with an open conversation.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 07 Jul 2007 04:03:41 +0000
parents ab6d2763b8d8
children 5c1ed6296b56 1ca6c4b234ab b7d27c13a061
comparison
equal deleted inserted replaced
18451:7122bcebf7c9 18452:45865fb3f4f9
2181 2181
2182 void 2182 void
2183 purple_accounts_delete(PurpleAccount *account) 2183 purple_accounts_delete(PurpleAccount *account)
2184 { 2184 {
2185 PurpleBlistNode *gnode, *cnode, *bnode; 2185 PurpleBlistNode *gnode, *cnode, *bnode;
2186 GList *iter;
2186 2187
2187 g_return_if_fail(account != NULL); 2188 g_return_if_fail(account != NULL);
2188 2189
2189 /* 2190 /*
2190 * Disable the account before blowing it out of the water. 2191 * Disable the account before blowing it out of the water.
2227 if (c->account == account) 2228 if (c->account == account)
2228 purple_blist_remove_chat(c); 2229 purple_blist_remove_chat(c);
2229 } 2230 }
2230 cnode = cnode_next; 2231 cnode = cnode_next;
2231 } 2232 }
2233 }
2234
2235 /* Remove any open conversation for this account */
2236 for (iter = purple_get_conversations(); iter; ) {
2237 PurpleConversation *conv = iter->data;
2238 iter = iter->next;
2239 if (purple_conversation_get_account(conv) == account)
2240 purple_conversation_destroy(conv);
2232 } 2241 }
2233 2242
2234 /* Remove this account's pounces */ 2243 /* Remove this account's pounces */
2235 purple_pounce_destroy_all_by_account(account); 2244 purple_pounce_destroy_all_by_account(account);
2236 2245