[AVFoundation] Fix AVAudioSession.EndInterruption event unsubscription - #26326
Conversation
…n removing the wrong delegate The `remove` accessor for `AVAudioSession.EndInterruption` incorrectly detached `cbBeginInterruption` instead of `cbEndInterruption`. This meant `EndInterruption` handlers were never removed, and `BeginInterruption` handlers could be removed unexpectedly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes an event unsubscription bug in the AVFoundation binding where AVAudioSession.EndInterruption’s remove accessor detached the wrong callback field, preventing handlers from being removed correctly and potentially removing BeginInterruption handlers unexpectedly.
Changes:
- Correct
AVAudioSession.EndInterruption’sremoveaccessor to unsubscribe fromcbEndInterruption(matching theaddaccessor).
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build #01f2a3a] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 203 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
The
removeaccessor forAVAudioSession.EndInterruptionincorrectlydetached
cbBeginInterruptioninstead ofcbEndInterruption. As a result:EndInterruptionwere never actually removed.BeginInterruptioncould be removed unexpectedly.Changed the
removeaccessor to detachcbEndInterruption.I also scanned the entire
src/tree for any other event where theaddand
removeaccessors reference mismatched backing fields, and found noother occurrences — this was the only one.
🤖 Pull request created by Copilot