From ee2c733732004fdd45024cde648e6d12ce4c8c45 Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 20:33:57 +0000 Subject: [PATCH] settings_ui: Defer `fetch_files` to avoid reentrant lease of `Project` (#50488) (cherry-pick to stable) (#50741) Cherry-pick of #50488 to stable ---- Closes ZED-5CA Release Notes: - Fixed a crash when opening the settings UI. Co-authored-by: Cole Miller --- crates/settings_ui/src/settings_ui.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs index 9ac338f7b849a53c402a0cea6b79ddc6496df0f2..def4c7630869cae69c539e1d83660e8df9a18318 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)); })