diff options
author | Rasmus Steinke <rasi@xssn.at> | 2017-08-12 15:27:04 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2017-08-12 15:27:04 +0200 |
commit | 125cc17f61a5f382164e3364850c9e4ef0645d3b (patch) | |
tree | 5d7c6e5822cc84d6cac6f49699e19059aba621fd | |
parent | 34cadbba822a82840e4ef6807499b24eb0c086fa (diff) | |
download | perl-app-clerk-125cc17f61a5f382164e3364850c9e4ef0645d3b.tar.gz perl-app-clerk-125cc17f61a5f382164e3364850c9e4ef0645d3b.tar.xz |
close mpd socket properly
-rwxr-xr-x | clerk | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -228,6 +228,8 @@ sub random { my @queue_cmd = ('tmux', 'findw', '-t', 'music', 'queue'); my @action_items = ("Album\n", "Tracks\n", "Settings\n"); my $action = backend_call(\@action_items, "1,2,3", "cancel"); + try { $mpd->close(); }; + $mpd->{socket}->close; if ($action eq "Album\n") { $mpd->clear(); my @album_artists = $mpd->list('albumartist'); @@ -268,6 +270,8 @@ sub do_action { my ($in, $context) = @_; my @action_items = ("Add\n", "Replace\n"); my $action = backend_call(\@action_items); + try { $mpd->close(); }; + $mpd->{socket}->close; if ($action eq "Replace\n") { $mpd->clear(); } |