mpd: fix FD leak by resetting connection on MPD_ERROR_SYSTEM errors

Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-23 23:04:36 +00:00
parent 65fadcf94b
commit 82f076c6c2

View File

@ -323,6 +323,7 @@ void waybar::modules::MPD::checkErrors(mpd_connection* conn) {
case MPD_ERROR_SYSTEM:
if (auto ec = mpd_connection_get_system_error(conn); ec != 0) {
mpd_connection_clear_error(conn);
connection_.reset();
throw std::system_error(ec, std::system_category());
}
G_GNUC_FALLTHROUGH;