diff --git a/src/modules/mpd.cpp b/src/modules/mpd.cpp index a3960787..3699d4ab 100644 --- a/src/modules/mpd.cpp +++ b/src/modules/mpd.cpp @@ -70,7 +70,15 @@ MpdModule::MpdModule(std::string name_) MpdModule::~MpdModule() { std::lock_guard lck(this->update_lock); - this->status.reset(); + { + if (this->mpd->connected()) { + try { + this->mpd->disconnect(); + } catch (mpd::Exception &e) { + get_logger()->debug(e.what()); + } + } + } } void MpdModule::start()