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.

Get tests passing

Nathan Sobo8e36da1382e8
diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs
index 45169ed3af4..bd615522c26 100644
--- a/crates/gpui/src/app.rs
+++ b/crates/gpui/src/app.rs
@@ -3831,7 +3831,14 @@ impl<V: View> WindowHandle<V> {
// TODO: Implement window dropping behavior when we don't call this.
pub fn detach(mut self, cx: &impl BorrowAppContext) -> ViewHandle<V> {
let root = self.root(cx);
- self.any_handle.ref_counts.take();
+ let ref_counts = self.any_handle.ref_counts.take();
+ #[cfg(any(test, feature = "test-support"))]
+ ref_counts
+ .unwrap()
+ .lock()
+ .leak_detector
+ .lock()
+ .handle_dropped(self.id(), self.any_handle.handle_id);
root
}