Skip to content

Commit

Permalink
Remove unnecessary unsafe impls for WinitWindows on Wasm (#11270)
Browse files Browse the repository at this point in the history
# Objective

In the past `winit::window::Window` was not Send + Sync on web.
rust-windowing/winit#2834 made
`winit::window::Window` Sync + Send so Bevy's `unsafe impl` is no longer
necessary.

## Solution

Remove the unsafe impls.
  • Loading branch information
kettle11 authored Jan 9, 2024
1 parent 6901688 commit 13d3de8
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 @@ -356,9 +356,3 @@ pub fn winit_window_position(
}
}
}

// 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 13d3de8

Please sign in to comment.