Skip to content

Commit

Permalink
Added safety clarification to create_surface
Browse files Browse the repository at this point in the history
This clarifies that the window that a surface is created on must be kept
alive for the lifetime of the surface. This requirement and a proposal
to change it are described in gfx-rs#1463
  • Loading branch information
ecton committed Aug 12, 2021
1 parent 4dc0e26 commit 494bde0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,8 @@ impl Instance {
///
/// # Safety
///
/// - Raw Window Handle must be a valid object to create a surface upon.
/// - Raw Window Handle must be a valid object to create a surface upon and
/// must remain valid for the lifetime of the returned surface.
pub unsafe fn create_surface<W: raw_window_handle::HasRawWindowHandle>(
&self,
window: &W,
Expand Down

0 comments on commit 494bde0

Please sign in to comment.