fixed: close the mpd socket and stop the mpd client thread before exiting

This commit is contained in:
Bob van Loosen 2012-12-27 18:18:43 +01:00
parent e4d40a807c
commit 3d365f0ea9
2 changed files with 6 additions and 1 deletions

View file

@ -209,6 +209,9 @@ void CBitVis::Process()
} }
m_jackclient.Disconnect(); m_jackclient.Disconnect();
m_mpdclient->StopThread();
delete m_mpdclient;
m_mpdclient = NULL;
} }
void CBitVis::ProcessSignalfd() void CBitVis::ProcessSignalfd()

View file

@ -35,13 +35,15 @@ void CMpdClient::Process()
if (!GetCurrentSong() || !GetPlayStatus()) if (!GetCurrentSong() || !GetPlayStatus())
{ {
m_socket.Close(); m_socket.Close();
USleep(10000000); USleep(10000000, &m_stop);
} }
else else
{ {
USleep(1000000); USleep(1000000);
} }
} }
m_socket.Close();
} }
bool CMpdClient::OpenSocket() bool CMpdClient::OpenSocket()