changeset 26540:384eaba9974e

Reset some global data when uninit-ing. Fixes a crash on quit.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 11 Apr 2009 06:01:36 +0000
parents 4f2f5659aa0d
children 15ae2dea92b3
files libpurple/account.c libpurple/blist.c
diffstat 2 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Sat Apr 11 06:00:50 2009 +0000
+++ b/libpurple/account.c	Sat Apr 11 06:01:36 2009 +0000
@@ -2787,7 +2787,6 @@
 void
 purple_accounts_uninit(void)
 {
-	GList* account;
 	gpointer handle = purple_accounts_get_handle();
 	if (save_timer != 0)
 	{
@@ -2799,9 +2798,6 @@
 	purple_signals_disconnect_by_handle(handle);
 	purple_signals_unregister_by_instance(handle);
 
-	account = purple_accounts_get_all();
-	while (account) {
-		purple_account_destroy(account->data);
-		account = g_list_delete_link(account, account);
-	}
+	for (; accounts; accounts = g_list_delete_link(accounts, accounts))
+		purple_account_destroy(accounts->data);
 }
--- a/libpurple/blist.c	Sat Apr 11 06:00:50 2009 +0000
+++ b/libpurple/blist.c	Sat Apr 11 06:01:36 2009 +0000
@@ -2616,7 +2616,7 @@
 purple_blist_node_destroy(PurpleBlistNode *node)
 {
 	PurpleBlistNode *child, *next_child;
-  
+
 	child = node->child;
 	while (child) {
 		next_child = child->next;
@@ -2936,6 +2936,7 @@
 		purple_blist_node_destroy(node);
 		node = next_node;
 	}
+	purplebuddylist->root = NULL;
 
 	purple_signals_unregister_by_instance(purple_blist_get_handle());
 }