Added safety clarification to create_surface

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 https://github.com/gfx-rs/wgpu/issues/1463
This commit is contained in:
Jonathan Johnson committed 2021-08-12 09:04:02 -07:00
1 parent 4dc0e265ac
commit 494bde01c2
1 file changed
+2 -1
+2 -1
View File
@@ -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,