refactor(tracker): new closing mechanism logic

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2025-04-30 22:42:35 +03:00
parent 9f89c37956
commit 554a840982
9 changed files with 172 additions and 137 deletions

View File

@ -8,6 +8,7 @@ import (
"path/filepath"
"runtime"
"runtime/pprof"
"time"
"gioui.org/app"
"github.com/vsariola/sointu"
@ -71,7 +72,8 @@ func main() {
go func() {
trackerUi.Main()
audioCloser.Close()
detector.Close()
tracker.TrySend(broker.CloseDetector, struct{}{})
tracker.TimeoutReceive(broker.FinishedDetector, 3*time.Second)
if *cpuprofile != "" {
pprof.StopCPUProfile()
f.Close()