mirror of
https://github.com/polybar/polybar.git
synced 2026-03-01 21:58:53 +00:00
fix(mpd): Disconnect on destruct
This commit is contained in:
@ -70,7 +70,15 @@ MpdModule::MpdModule(std::string name_)
|
||||
MpdModule::~MpdModule()
|
||||
{
|
||||
std::lock_guard<concurrency::SpinLock> 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()
|
||||
|
||||
Reference in New Issue
Block a user