From 494bde01c2bc84f21724af1191dc0b19a8a282b3 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Thu, 12 Aug 2021 09:04:02 -0700 Subject: [PATCH] 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 --- wgpu/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 816c86474b..32905c6c94 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -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( &self, window: &W,