From d4e0f73ffe0b6513322b0bb8f6652c067a97e5a0 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 13 Jul 2022 10:19:46 +0200 Subject: [PATCH] Drop window borrow before calling `makeKeyAndOrderFront` We're seeing some stack traces where calling `makeKeyAndOrderFront` could invoke `setFrameSize`, which is causing a double borrow. --- crates/gpui/src/platform/mac/window.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs index 5e6b3b9c19..294f169c45 100644 --- a/crates/gpui/src/platform/mac/window.rs +++ b/crates/gpui/src/platform/mac/window.rs @@ -402,7 +402,8 @@ impl platform::Window for Window { } fn activate(&self) { - unsafe { msg_send![self.0.borrow().native_window, makeKeyAndOrderFront: nil] } + let window = self.0.borrow().native_window; + unsafe { msg_send![window, makeKeyAndOrderFront: nil] } } fn set_title(&mut self, title: &str) {