Mercurial > pidgin
comparison src/blist.c @ 10166:72c9e9bb2c19
[gaim-migrate @ 11252]
A nice contact-deletion crash fix from Andrew Hart. Thanks Andrew!
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Tue, 09 Nov 2004 05:48:26 +0000 |
| parents | 9fdbfe832fac |
| children | 35eae887271a |
comparison
equal
deleted
inserted
replaced
| 10165:5c3b27763126 | 10166:72c9e9bb2c19 |
|---|---|
| 1177 gnode = node->parent; | 1177 gnode = node->parent; |
| 1178 | 1178 |
| 1179 if (node->child) { | 1179 if (node->child) { |
| 1180 /* | 1180 /* |
| 1181 * If this contact has children then remove them. When the last | 1181 * If this contact has children then remove them. When the last |
| 1182 * buddy is removed from the contact, the contact is deleted. | 1182 * buddy is removed from the contact, the contact is automatically |
| 1183 * deleted. | |
| 1183 */ | 1184 */ |
| 1184 while (node->child) { | 1185 while (node->child->next) { |
| 1185 gaim_blist_remove_buddy((GaimBuddy*)node->child); | 1186 gaim_blist_remove_buddy((GaimBuddy*)node->child); |
| 1186 } | 1187 } |
| 1188 /* | |
| 1189 * Remove the last buddy and trigger the deletion of the contact. | |
| 1190 * It would probably be cleaner if contact-deletion was done after | |
| 1191 * a timeout? Or if it had to be done manually, like below? | |
| 1192 */ | |
| 1193 gaim_blist_remove_buddy((GaimBuddy*)node->child); | |
| 1187 } else { | 1194 } else { |
| 1188 /* Remove the node from its parent */ | 1195 /* Remove the node from its parent */ |
| 1189 if (gnode->child == node) | 1196 if (gnode->child == node) |
| 1190 gnode->child = node->next; | 1197 gnode->child = node->next; |
| 1191 if (node->prev) | 1198 if (node->prev) |
