From 3d365f0ea920618a4c16f0a5c9e1749999bf32df Mon Sep 17 00:00:00 2001 From: Bob van Loosen Date: Thu, 27 Dec 2012 18:18:43 +0100 Subject: [PATCH] fixed: close the mpd socket and stop the mpd client thread before exiting --- src/bitvis.cpp | 3 +++ src/mpdclient.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bitvis.cpp b/src/bitvis.cpp index f4db719..05c8277 100644 --- a/src/bitvis.cpp +++ b/src/bitvis.cpp @@ -209,6 +209,9 @@ void CBitVis::Process() } m_jackclient.Disconnect(); + m_mpdclient->StopThread(); + delete m_mpdclient; + m_mpdclient = NULL; } void CBitVis::ProcessSignalfd() diff --git a/src/mpdclient.cpp b/src/mpdclient.cpp index 6e77460..d05a06f 100644 --- a/src/mpdclient.cpp +++ b/src/mpdclient.cpp @@ -35,13 +35,15 @@ void CMpdClient::Process() if (!GetCurrentSong() || !GetPlayStatus()) { m_socket.Close(); - USleep(10000000); + USleep(10000000, &m_stop); } else { USleep(1000000); } } + + m_socket.Close(); } bool CMpdClient::OpenSocket()