Avoid a possible race condition with the player delegate#893
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces the chance of a weak SFBAudioPlayer.delegate being deallocated between respondsToSelector: checks and the subsequent delegate message sends by snapshotting the delegate into a strong local before invoking callbacks.
Changes:
- Snapshot
player_.delegate(andplayer.delegateinside blocks) into a strong local variable before checking selectors and calling delegate methods. - Apply the snapshot pattern across playback state, now-playing, decoding, rendering, and interruption/configuration-change notifications.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.