-
Notifications
You must be signed in to change notification settings - Fork 488
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
8267819: CoInitialize/CoUninitialize should be called on same thread #521
Conversation
👋 Welcome back almatvee! A progress list of the required criteria for merging this PR into |
/reviewers 2 |
@kevinrushforth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and I think it's cleaner this way too. Two questions:
- Have you verified that it still works correctly on RDP reconnect?
- This isn't really related to your fix, since the logic for this part is the same before and after, should the rest of the
Init
method be short-circuited ifCoInitialize
fails?
|
bool bCallCoUninitialize = true; | ||
bool bResult = false; | ||
|
||
if (FAILED(CoInitialize(NULL))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the CoUninitialize
doc, CoUninitialize
should also be called if CoInitialize
returns S_FALSE.
Can you please check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be called. S_FALSE is not a failure and defined as 1. FAILED macro returns true if error code < 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@sashamatveev This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
@sashamatveev Since your change was applied there have been 2 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 47700d8. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
JDK-8264737 introduced new code for audio device removal/arrival notifications which calls CoInitialize/CoUninitialize on separate threads. CoInitialize/CoUninitialize should be called on same thread, since initialization is per thread. Doing it on separate thread will result in unloading COM libraries on that thread and if it uses COM libraries it might not work correctly. Fixed by calling it on same thread in same way it is done in dshowwrapper.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/521/head:pull/521
$ git checkout pull/521
Update a local copy of the PR:
$ git checkout pull/521
$ git pull https://git.openjdk.java.net/jfx pull/521/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 521
View PR using the GUI difftool:
$ git pr show -t 521
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/521.diff