CsWinRT
CsWinRT copied to clipboard
Stop relying on UB in 'IContextCallback' dispatch logic
See https://github.com/dotnet/runtime/blob/main/docs/design/specs/Memory-model.md#cross-thread-access-to-local-variables. This PR fixes accessing the callback state (which is a managed object) from the native callback invoked on the target thread.