Skip to content

[Merged by Bors] - Make WinitWindows non send#4027

Closed
aevyrie wants to merge 1 commit intobevyengine:mainfrom
aevyrie:nonsend-winit
Closed

[Merged by Bors] - Make WinitWindows non send#4027
aevyrie wants to merge 1 commit intobevyengine:mainfrom
aevyrie:nonsend-winit

Conversation

@aevyrie
Copy link
Copy Markdown
Member

@aevyrie aevyrie commented Feb 23, 2022

Objective

Solution

  • Make the WinitWindows resource !Send.
  • This ensures that any systems that use WinitWindows must either be exclusive (run on the main thread), or the resource is explicitly marked with the NonSend parameter in user systems.

@alice-i-cecile
Copy link
Copy Markdown
Member

Checks out, and the comments are very helpful.

@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior and removed S-Needs-Triage This issue needs to be labelled labels Feb 23, 2022
@cart
Copy link
Copy Markdown
Member

cart commented Feb 24, 2022

bors r+

bors bot pushed a commit that referenced this pull request Feb 24, 2022
# Objective

- Fixes #4010, as well as any similar issues in this class.
- Winit functions used outside of the main thread can cause the application to unexpectedly hang.

## Solution

- Make the `WinitWindows` resource `!Send`.
- This ensures that any systems that use `WinitWindows` must either be exclusive (run on the main thread), or the resource is explicitly marked with the `NonSend` parameter in user systems.
@bors bors bot changed the title Make WinitWindows non send [Merged by Bors] - Make WinitWindows non send Feb 24, 2022
@bors bors bot closed this Feb 24, 2022
kurtkuehnert pushed a commit to kurtkuehnert/bevy that referenced this pull request Mar 6, 2022
# Objective

- Fixes bevyengine#4010, as well as any similar issues in this class.
- Winit functions used outside of the main thread can cause the application to unexpectedly hang.

## Solution

- Make the `WinitWindows` resource `!Send`.
- This ensures that any systems that use `WinitWindows` must either be exclusive (run on the main thread), or the resource is explicitly marked with the `NonSend` parameter in user systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Window intermittently crashes on Windows 10 & 11 on startup if setting a Window Icon using Winit

3 participants