Fix deadlock on exit by making mic level updates async

This commit is contained in:
Jose Luis Montañes Ojados
2026-01-17 17:06:46 +01:00
parent 2860102627
commit b66e0737d0
2 changed files with 6 additions and 1 deletions

View File

@@ -337,7 +337,8 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// Update mic level for display (use the calculated level)
if m.program != nil {
m.program.Send(micLevelMsg(level))
// Use goroutine to prevent blocking the capture loop if the UI is busy (e.g. shutting down)
go m.program.Send(micLevelMsg(level))
}
})
m.addLog("Audio capturer initialized")