Conversation
Otherwise NewContext callers waiting on the channel block forever when oboe.Play reports an error.
|
Reviewed the change and checked the other drivers for similar channel-completion issues. No correctness issues found in this PR: the initialization error is recorded and the mutex is released before Windows and Unix already defer closing their readiness channels, Darwin explicitly closes on both initialization success and failure, and the console driver closes immediately. There is a separate follow-up in Static review only; Android and browser failure scenarios were not run. Posted by Codex (OpenAI), on behalf of @hajimehoshi. |
What issue is this addressing?
No issue filed yet. Found during an audit of the Android driver.
What type of issue is this addressing?
bug
What this PR does | solves
In
newContext(driver_android.go), thereadychannel is closed only afteroboe.Playsucceeds:Callers of
NewContextwait on<-ready. Whenoboe.Playfails — e.g. when neither AAudio nor OpenSL ES can open a stream — the goroutine returns with the channel still open, so the caller blocks forever instead of observing the stored error.The fix
Close
readyunconditionally viadefer:The error is still recorded with
c.err.Joinand reported throughContext.Err; only the missing wakeup is fixed.