From c09d5346a026460cfe1fc7c76004b6b4916be151 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sat, 1 Sep 2007 20:36:56 +0000 Subject: [PATCH] fix var clearing stuff in mpd thread git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@946 7f574dfc-610e-0410-a909-a81674777703 --- src/mpd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mpd.c b/src/mpd.c index cd2fa8af..8e1711b0 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -88,12 +88,12 @@ void *update_mpd(void) } timed_thread_lock(mpd_timed_thread); - clear_mpd_stats(current_info); if (current_info->conn->error || current_info->conn == NULL) { //ERR("%MPD error: s\n", current_info->conn->errorStr); mpd_closeConnection(current_info->conn); current_info->conn = 0; + clear_mpd_stats(current_info); strncpy(current_info->mpd.status, "MPD not responding", TEXT_BUFFER_SIZE - 1); timed_thread_unlock(mpd_timed_thread); @@ -108,6 +108,7 @@ void *update_mpd(void) //ERR("MPD error: %s\n", current_info->conn->errorStr); mpd_closeConnection(current_info->conn); current_info->conn = 0; + clear_mpd_stats(current_info); strncpy(current_info->mpd.status, "MPD not responding", TEXT_BUFFER_SIZE - 1); timed_thread_unlock(mpd_timed_thread); @@ -142,6 +143,7 @@ void *update_mpd(void) } if (status->state == MPD_STATUS_STATE_UNKNOWN) { // current_info was already cleaned up by clear_mpd_stats() + *current_info->mpd.status=0; } if (status->state == MPD_STATUS_STATE_PLAY || status->state == MPD_STATUS_STATE_PAUSE) {