summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-11-08 19:34:51 +0100
committerxengineering <me@xengineering.eu>2024-11-08 19:34:51 +0100
commitc5b70859438b22e0e186c57037aee02adde5399b (patch)
tree614177aed44d9b91eb4c68a61f69b74aad09973e
parentdbc0b05e4bbd939cd4dce6cadb833a860ff2c0d5 (diff)
downloadsoundbox-app-c5b70859438b22e0e186c57037aee02adde5399b.tar
soundbox-app-c5b70859438b22e0e186c57037aee02adde5399b.tar.zst
soundbox-app-c5b70859438b22e0e186c57037aee02adde5399b.zip
Fix zombie ffmpeg process
In case of closing the UI window while the player was active the `ffmpeg` process continued while soundbox-app was closed. This is highly unwanted behavior since the user is not able to stop it without advanced tools. Waiting properly for the player context to be done solves the issue.
-rw-r--r--main.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.go b/main.go
index 47429cf..060f76c 100644
--- a/main.go
+++ b/main.go
@@ -75,7 +75,9 @@ func (ui *Ui) Cleanup() {
defer ui.State.Unlock()
if ui.State.PlayerCancel != nil {
+ done := ui.State.PlayerContext.Done()
ui.State.PlayerCancel()
+ <-done
}
}