Commit c295b7c
committed
Fix tray icon stuck on "listening" after Stop (deadlock) + bump 0.3.29
Engine.Stop() held e.mu while calling cap.Close(). Close ->
device.Uninit() blocks until the in-flight audio callback returns, and
that callback (onFrame) starts by taking e.mu — so Stop and the audio
thread deadlocked against each other whenever a frame was in flight at
click time. The UI goroutine froze inside Stop: running stayed true, the
mic was never released (kept listening), and the icon never reset.
Flip running/cap under the lock, release it, then tear the device down
outside the lock so the in-flight onFrame can finish. Also force
setProcessing(false) afterwards: stopping mid-speech leaves the VAD
segmenter InSpeech, so the "processing" icon would otherwise never clear.
🤖 Generated with Claude Code1 parent 83fc0ee commit c295b7c
2 files changed
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
272 | 279 | | |
273 | 280 | | |
274 | | - | |
275 | 281 | | |
| 282 | + | |
276 | 283 | | |
277 | 284 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 285 | + | |
| 286 | + | |
282 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
283 | 296 | | |
284 | 297 | | |
285 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
0 commit comments