Fix deadlock on exit by making mic level updates async
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user