Mercurial > pidgin
comparison src/list.c @ 4721:91ef4fae4a49
[gaim-migrate @ 5033]
plug a leak or two, and make removing buddies not blow up.
committer: Tailor Script <tailor@pidgin.im>
| author | Nathan Walp <nwalp@pidgin.im> |
|---|---|
| date | Wed, 12 Mar 2003 02:27:28 +0000 |
| parents | 06e8e5858121 |
| children | e4a8c7215fdf |
comparison
equal
deleted
inserted
replaced
| 4720:06e8e5858121 | 4721:91ef4fae4a49 |
|---|---|
| 294 | 294 |
| 295 void gaim_blist_remove_buddy (struct buddy *buddy) | 295 void gaim_blist_remove_buddy (struct buddy *buddy) |
| 296 { | 296 { |
| 297 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; | 297 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; |
| 298 | 298 |
| 299 GaimBlistNode *node = (GaimBlistNode*)buddy; | 299 GaimBlistNode *gnode, *node = (GaimBlistNode*)buddy; |
| 300 | 300 struct group *group; |
| 301 | |
| 302 gnode = node->parent; | |
| 303 group = (struct group *)gnode; | |
| 304 | |
| 305 if(gnode->child == node) | |
| 306 gnode->child = node->next; | |
| 301 if (node->prev) | 307 if (node->prev) |
| 302 node->prev->next = node->next; | 308 node->prev->next = node->next; |
| 303 if (node->next) | 309 if (node->next) |
| 304 node->next->prev = node->prev; | 310 node->next->prev = node->prev; |
| 305 | 311 |
| 312 group->members = g_slist_remove(group->members, buddy); | |
| 313 | |
| 306 ops->remove(gaimbuddylist, node); | 314 ops->remove(gaimbuddylist, node); |
| 307 g_free(buddy->name); | 315 g_free(buddy->name); |
| 308 g_free(buddy->alias); | 316 g_free(buddy->alias); |
| 309 g_free(buddy); | 317 g_free(buddy); |
| 310 } | 318 } |
