changeset 11464:610a243b4504

[gaim-migrate @ 13704] Fix Gaim's crash-on-exit bug in CVS HEAD committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 07 Sep 2005 04:37:02 +0000
parents 448ebda0f7ec
children 448bc3b8eb63
files src/core.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/core.c	Wed Sep 07 04:00:11 2005 +0000
+++ b/src/core.c	Wed Sep 07 04:37:02 2005 +0000
@@ -157,7 +157,6 @@
 	gaim_savedstatuses_uninit();
 	gaim_status_uninit();
 	gaim_prefs_uninit();
-	gaim_sound_uninit();
 	gaim_xfers_uninit();
 
 	gaim_debug_info("main", "Unloading all plugins\n");
@@ -167,6 +166,19 @@
 	if (ops != NULL && ops->quit != NULL)
 		ops->quit();
 
+	/*
+	 * gaim_sound_uninit() should be called as close to
+	 * shutdown as possible.  This is because the call
+	 * to ao_shutdown() can sometimes leave our
+	 * environment variables in an unusable state, which
+	 * can cause a crash when getenv is called (by gettext
+	 * for example).  See the complete bug report at
+	 * http://trac.xiph.org/cgi-bin/trac.cgi/ticket/701
+	 *
+	 * TODO: Eventually move this call higher up with the others.
+	 */
+	gaim_sound_uninit();
+
 	gaim_plugins_uninit();
 	gaim_signals_uninit();