Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix segfault when dropping MacWindow (#9267)

Thorsten Ball754df9356d81
diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs
index 196c861a937..e648f508b66 100644
--- a/crates/gpui/src/platform/mac/window.rs
+++ b/crates/gpui/src/platform/mac/window.rs
@@ -695,10 +695,11 @@ impl Drop for MacWindow {
this.renderer.destroy();
let window = this.native_window;
this.display_link.take();
- unsafe {
- this.native_window.setDelegate_(nil);
- }
if !this.native_window_was_closed {
+ unsafe {
+ this.native_window.setDelegate_(nil);
+ }
+
this.executor
.spawn(async move {
unsafe {