changeset 24899:60ae522a239a

Rearrange prefs uninitialization now that it actually does something. This should prevent an infinite loop that occurs when trying to debug after prefs are uninit'd. Paul Aurich figured this out. Fixes #7761
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 03 Jan 2009 18:37:37 +0000
parents fec1e38cb330
children 6267675cbc1d 1563f269a714
files libpurple/core.c libpurple/prefs.c
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/core.c	Fri Jan 02 22:41:11 2009 +0000
+++ b/libpurple/core.c	Sat Jan 03 18:37:37 2009 +0000
@@ -137,7 +137,7 @@
 	 * subsystem right away too.
 	 */
 	purple_plugins_init();
-	
+
 	/* Initialize all static protocols. */
 	static_proto_init();
 
@@ -213,7 +213,6 @@
 	purple_accounts_uninit();
 	purple_savedstatuses_uninit();
 	purple_status_uninit();
-	purple_prefs_uninit();
 	purple_sound_uninit();
 	purple_xfers_uninit();
 	purple_proxy_uninit();
@@ -244,6 +243,7 @@
 #ifdef _WIN32
 	wpurple_cleanup();
 #endif
+	purple_prefs_uninit();
 
 	_core = NULL;
 }
--- a/libpurple/prefs.c	Fri Jan 02 22:41:11 2009 +0000
+++ b/libpurple/prefs.c	Sat Jan 03 18:37:37 2009 +0000
@@ -714,7 +714,8 @@
 
 	name = pref_full_name(pref);
 
-	purple_debug_info("prefs", "removing pref %s\n", name);
+	if (prefs_loaded)
+		purple_debug_info("prefs", "removing pref %s\n", name);
 
 	g_hash_table_remove(prefs_hash, name);
 	g_free(name);
@@ -1453,7 +1454,7 @@
 		save_timer = 0;
 		sync_prefs();
 	}
-
+	prefs_loaded = FALSE;
 	purple_prefs_disconnect_by_handle(purple_prefs_get_handle());
 	purple_prefs_destroy();
 	g_hash_table_destroy(prefs_hash);