diff -dPNur xmms-1.2.10-gentoo/xmms/main.c xmms-1.2.10-new/xmms/main.c
--- xmms-1.2.10-gentoo/xmms/main.c	2005-12-29 02:48:54.000000000 +0000
+++ xmms-1.2.10-new/xmms/main.c	2005-12-29 02:51:06.000000000 +0000
@@ -3017,6 +3017,8 @@
 	
 }
 
+static sig_atomic_t exit_flag = 0;
+
 gint idle_func(gpointer data)
 {
 	gint time, t, length;
@@ -3026,6 +3028,8 @@
 
 	static GTimer *pause_timer = NULL;
 
+	if (exit_flag) mainwin_quit_cb();
+
 	if (get_input_playing())
 	{
 		GDK_THREADS_ENTER();
@@ -3393,13 +3397,7 @@
 /* Try to exit nicely when receiving a nice exit signal */
 void sigterm_handler(int sig)
 {
-	/* Original author of patch said that you should not use mainwin_quit_cb(),
-	 * but his way deadlock xmms, and it anyhow just calls ctrlsocket stuff with
-	 * with CMD_QUIT, which anyhow calls mainwin_quit_cb() in turn.  This is not
-	 * entirely clean, but works.
-	 * <azarah@gentoo.org> (19 Jan 2003)
-	xmms_remote_quit(ctrlsocket_get_session_id()); */
-	mainwin_quit_cb();
+	exit_flag = 1;
 }
 
 static gboolean pposition_configure(GtkWidget *w, GdkEventConfigure *event, gpointer data)