From 8eb2f7766a3d414fbc7f21d8b353ae2a007d196e Mon Sep 17 00:00:00 2001 From: Philip Degarmo Date: Sat, 2 Mar 2024 13:40:34 -0800 Subject: [PATCH] Fix crash when swapchain is dropped on macos --- rafx-api/src/backends/metal/internal/extra_ffi.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rafx-api/src/backends/metal/internal/extra_ffi.rs b/rafx-api/src/backends/metal/internal/extra_ffi.rs index 65012ebad..077e8884d 100644 --- a/rafx-api/src/backends/metal/internal/extra_ffi.rs +++ b/rafx-api/src/backends/metal/internal/extra_ffi.rs @@ -29,8 +29,7 @@ impl NSWindowWrapper { let is_actually_window: BOOL = msg_send![window, isKindOfClass: class]; assert_eq!(is_actually_window, YES); - let ptr = StrongPtr::new(window); - StrongPtr::retain(window); + let ptr = StrongPtr::retain(window); NSWindowWrapper(ptr) } }