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

Fix race condition in NimBLEScan::clearResults. #855

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

h2zero
Copy link
Owner

@h2zero h2zero commented Jan 12, 2025

If clear results is called from more than one task a race condition exists that may delete the same advertisedDevice twice. This prevents this by swapping with an empty vector and testing for empty before freeing the resources.

If clear results is called from more than one task a race condition exists that may delete the same advertisedDevice twice.
This prevents this by swapping with an empty vector and testing for empty before freeing the resources.
@h2zero h2zero force-pushed the bugfix/scan-clearResults-crash branch from 6754d61 to cbbbbb2 Compare January 13, 2025 00:19
@h2zero h2zero merged commit 5d41802 into master Jan 13, 2025
31 checks passed
@h2zero h2zero deleted the bugfix/scan-clearResults-crash branch January 13, 2025 00:24
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