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

You forgot to call winrt::init_apartment(); in WinRT example #3

Closed
DJm00n opened this issue Apr 21, 2022 · 3 comments
Closed

You forgot to call winrt::init_apartment(); in WinRT example #3

DJm00n opened this issue Apr 21, 2022 · 3 comments

Comments

@DJm00n
Copy link

DJm00n commented Apr 21, 2022

See title :)

@MysteriousJ
Copy link
Owner

First I've heard of apartments. What is the functionality that's broken due to this missing call?

@DJm00n
Copy link
Author

DJm00n commented May 7, 2022

First I've heard of apartments. What is the functionality that's broken due to this missing call?

This is needed to properly init WinRT. Is calls RoInitialize under the hood.

I had random crashes in my own code without this call. Also there was crashes in SDL related to missing call to this function libsdl-org/SDL#5270

See https://docs.microsoft.com/windows/uwp/cpp-and-winrt-apis/get-started for details.
And contextfree/winrt-rust#62 (comment) for info about apartments.

@MysteriousJ
Copy link
Owner

Added in e2f1968

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

No branches or pull requests

2 participants