Skip to content

Commit

Permalink
Remove unnecessary unsafe Send and Sync impl for WinitWindows o…
Browse files Browse the repository at this point in the history
…n wasm. (bevyengine#5863)

# Objective

bevyengine#503 added these.
I don't know what problem it solved, the PR doesn't say and the code didn't make it obvious to me.

## Solution

AFAIK removing unsafe `Send`/`Sync` impls can't introduce unsoundness.
Yeet.

## Migration Guide
Why tho.


Co-authored-by: devil-ira <[email protected]>
  • Loading branch information
2 people authored and james7132 committed Oct 28, 2022
1 parent aa8293d commit 184ea9a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crates/bevy_winit/src/winit_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,3 @@ pub fn get_best_videomode(monitor: &winit::monitor::MonitorHandle) -> winit::mon

modes.first().unwrap().clone()
}

// WARNING: this only works under the assumption that wasm runtime is single threaded
#[cfg(target_arch = "wasm32")]
unsafe impl Send for WinitWindows {}
#[cfg(target_arch = "wasm32")]
unsafe impl Sync for WinitWindows {}

0 comments on commit 184ea9a

Please sign in to comment.