about summary refs log tree commit diff
path: root/tools/mpd-stats/internal/mpd
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mpd-stats/internal/mpd')
-rw-r--r--tools/mpd-stats/internal/mpd/mpd.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/mpd-stats/internal/mpd/mpd.go b/tools/mpd-stats/internal/mpd/mpd.go
index ed9d3c2..cebf2b2 100644
--- a/tools/mpd-stats/internal/mpd/mpd.go
+++ b/tools/mpd-stats/internal/mpd/mpd.go
@@ -36,3 +36,13 @@ func NewPlayer(net string, addr string) (*player, error) {
 
 	return &p, nil
 }
+
+func (p *player) Close() error {
+	if err := p.Watcher.Close(); err != nil {
+		return err
+	}
+	if err := p.Client.Close(); err != nil {
+		return err
+	}
+	return nil
+}