RFR: 8267819: CoInitialize/CoUninitialize should be called on same thread
Kevin Rushforth
kcr at openjdk.java.net
Fri May 28 01:25:07 UTC 2021
On Thu, 27 May 2021 04:18:24 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:
> 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.
Looks good, and I think it's cleaner this way too. Two questions:
1. Have you verified that it still works correctly on RDP reconnect?
2. 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 if `CoInitialize` fails?
-------------
Marked as reviewed by kcr (Lead).
PR: https://git.openjdk.java.net/jfx/pull/521
More information about the openjfx-dev
mailing list