pidgin: c1eb11b6: Rearrange prefs uninitialization now tha...

datallah at pidgin.im datallah at pidgin.im
Sat Jan 3 13:40:51 EST 2009


-----------------------------------------------------------------
Revision: c1eb11b61c6c6756eba2e3aa380e4e4e09db0914
Ancestor: b478b184a46116ac87ac85b8cd352ea564224019
Author: datallah at pidgin.im
Date: 2009-01-03T18:37:37
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/c1eb11b61c6c6756eba2e3aa380e4e4e09db0914

Modified files:
        libpurple/core.c libpurple/prefs.c

ChangeLog: 

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

-------------- next part --------------
============================================================
--- libpurple/core.c	361874bd3f2080adc3d38101a73fdf5ff2e65f56
+++ libpurple/core.c	4b25950b0f744009084a69c33a2707720965efc0
@@ -137,7 +137,7 @@ purple_core_init(const char *ui)
 	 * subsystem right away too.
 	 */
 	purple_plugins_init();
-	
+
 	/* Initialize all static protocols. */
 	static_proto_init();
 
@@ -213,7 +213,6 @@ purple_core_quit(void)
 	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 @@ purple_core_quit(void)
 #ifdef _WIN32
 	wpurple_cleanup();
 #endif
+	purple_prefs_uninit();
 
 	_core = NULL;
 }
============================================================
--- libpurple/prefs.c	155bb1ed1363d3d72bfc07cb890818a4cdb90e3d
+++ libpurple/prefs.c	e9a35b12de92bde6154b4bedbcab78939f50c3e7
@@ -714,7 +714,8 @@ remove_pref(struct purple_pref *pref)
 
 	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 @@ purple_prefs_uninit()
 		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);


More information about the Commits mailing list