Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only capture the absolute necessary values inside closures, to avoid improperly caching or reusing of core bluetooth objects #33

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

klundberg
Copy link
Collaborator

@klundberg klundberg commented Apr 23, 2024

Without this, client code that, for instance, calls monitorConnection(for:) (which returns a publisher that never completes) could erroneously keep the passed-in Peripheral (and the associated CBPeripheral) in memory for much longer than desired, which could lead to issues of reusing the peripheral by the system if it is invalid to do so.

…improperly caching or reusing of core bluetooth objects
@klundberg klundberg merged commit 2d42a73 into master Apr 23, 2024
5 checks passed
@klundberg klundberg deleted the capture-only-needed-values branch April 23, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant