# HG changeset patch # User Paul Aurich # Date 1241405695 0 # Node ID d97a130da2905b9917d44cf684e7cfccf56a59bf # Parent bcc577785c2b2f2d7f6622ad6e7fde33deb26f98 Fix a crash (from the single instance path) and leak of the node UI data. diff -r bcc577785c2b -r d97a130da290 libpurple/blist.c --- a/libpurple/blist.c Mon May 04 02:21:23 2009 +0000 +++ b/libpurple/blist.c Mon May 04 02:54:55 2009 +0000 @@ -2720,8 +2720,10 @@ static void purple_blist_node_destroy(PurpleBlistNode *node) { + PurpleBlistUiOps *ui_ops; PurpleBlistNode *child, *next_child; + ui_ops = purple_blist_get_ui_ops(); child = node->child; while (child) { next_child = child->next; @@ -2729,6 +2731,10 @@ child = next_child; } + /* Allow the UI to free data */ + if (ui_ops && ui_ops->remove) + ui_ops->remove(purplebuddylist, node); + if (PURPLE_BLIST_NODE_IS_BUDDY(node)) purple_buddy_destroy((PurpleBuddy*)node); else if (PURPLE_BLIST_NODE_IS_CHAT(node)) @@ -3049,6 +3055,10 @@ { PurpleBlistNode *node, *next_node; + /* This happens if we quit before purple_set_blist is called. */ + if (purplebuddylist == NULL) + return; + if (save_timer != 0) { purple_timeout_remove(save_timer); save_timer = 0;