Fix circular reference issue around PopoverMenu again (#44084)

Follow up to https://github.com/zed-industries/zed/pull/42351

Release Notes:

- N/A
This commit is contained in:
feeiyu
2025-12-03 21:34:01 +02:00
committed by GitHub
parent 4ef8433396
commit 92dcfdef76
4 changed files with 24 additions and 17 deletions
+3 -2
View File
@@ -161,7 +161,7 @@ impl Render for ModeSelector {
.map(|mode| mode.name.clone())
.unwrap_or_else(|| "Unknown".into());
let this = cx.entity();
let this = cx.weak_entity();
let icon = if self.menu_handle.is_deployed() {
IconName::ChevronUp
@@ -222,7 +222,8 @@ impl Render for ModeSelector {
y: px(-2.0),
})
.menu(move |window, cx| {
Some(this.update(cx, |this, cx| this.build_context_menu(window, cx)))
this.update(cx, |this, cx| this.build_context_menu(window, cx))
.ok()
})
}
}