-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
AudioUnitManager: Wrap every instance in a shared pointer #13945
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is slightly more defensive against issues during instantiation and also catches issues during sync instantiation.
4e6a2cc
to
430aa00
Compare
m0dB
reviewed
Nov 30, 2024
m0dB
reviewed
Nov 30, 2024
LGTM except for the missing p prefix. |
5fdc54f
to
e881740
Compare
Can this be merged? |
It LGTM, but I find it hard to assess the risk so close to 2.5 release. Then again, this is all very isolated. If @daschuer doesn't object, I will merge this. |
At least we have one user who reports, that this PR fixes an issue: #13967 (comment) |
LGTM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a small patch I extracted from #13887 (and rebased to 2.5), which fixes a dangling pointer issue when Audio Units are instantiated asynchronously.
The issue is that the async initialization callback captures the
AudioUnitManager
instance, which is unsafe if the instance doesn't outlive the callback. The solution is to simply wrap theAudioUnitManager
in aQSharedPointer
, which ensures that the callback keeps the manager instance alive for as long as necessary. See #13887 (comment) for further rationale.I consider it relatively safe to merge this for 2.5 since it doesn't change anything about the instantiation logic itself (Audio Units are still instantiated synchronously to read the parameters and asynchronously once activated). The migration to make everything asynchronous will then be deferred to 2.6 via #13887.