diff libpurple/core.c @ 25344:114e66c2fa7e

Reorder (and document) purple_core_quit() so that the prefs_uninit() fixes can be reenabled. Fixes #8064,#7761 committer: Daniel Atallah <daniel.atallah@gmail.com>
author Paul Aurich <paul@darkrain42.org>
date Tue, 20 Jan 2009 04:31:14 +0000
parents 1563f269a714
children 59ce16832872
line wrap: on
line diff
--- a/libpurple/core.c	Tue Jan 20 04:08:00 2009 +0000
+++ b/libpurple/core.c	Tue Jan 20 04:31:14 2009 +0000
@@ -198,10 +198,22 @@
 	/* Transmission ends */
 	purple_connections_disconnect_all();
 
+	/* The SSL plugins must be uninit before they're unloaded */
+	purple_ssl_uninit();
+
+	/* Unload all plugins before the UI because UI plugins might call
+	 * UI-specific functions */
+	purple_debug_info("main", "Unloading all plugins\n");
+	purple_plugins_destroy_all();
+
+	/* Shut down the UI before all the subsystems */
+	ops = purple_core_get_ui_ops();
+	if (ops != NULL && ops->quit != NULL)
+		ops->quit();
+
 	/* Save .xml files, remove signals, etc. */
 	purple_smileys_uninit();
 	purple_idle_uninit();
-	purple_ssl_uninit();
 	purple_pounces_uninit();
 	purple_blist_uninit();
 	purple_ciphers_uninit();
@@ -221,19 +233,15 @@
 	purple_imgstore_uninit();
 	purple_network_uninit();
 
-	purple_debug_info("main", "Unloading all plugins\n");
-	purple_plugins_destroy_all();
-
-	ops = purple_core_get_ui_ops();
-	if (ops != NULL && ops->quit != NULL)
-		ops->quit();
-
+	/* Everything after this must not try to read any prefs */
+	purple_prefs_uninit();
 	purple_plugins_uninit();
 #ifdef HAVE_DBUS
 	purple_dbus_uninit();
 #endif
 
 	purple_cmds_uninit();
+	/* Everything after this cannot try to write things to the confdir */
 	purple_util_uninit();
 
 	purple_signals_uninit();