Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
settings_ui: Defer `fetch_files` to avoid reentrant lease of `Project` (#50488)
Cole Millera09b6fba8812
diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rsindex 9ac338f7b84..def4c763086 100644--- a/crates/settings_ui/src/settings_ui.rs+++ b/crates/settings_ui/src/settings_ui.rs@@ -1574,8 +1574,10 @@ impl SettingsWindow {};this_weak- .update(cx, |this, cx| {- this.fetch_files(window, cx);+ .update(cx, |_, cx| {+ cx.defer_in(window, |settings_window, window, cx| {+ settings_window.fetch_files(window, cx)+ });cx.observe_release_in(&project, window, |_, _, window, cx| {cx.defer_in(window, |this, window, cx| this.fetch_files(window, cx));})