From a09b6fba88125ce446fb00a5271161c36f933b58 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Mon, 2 Mar 2026 09:33:48 -0500 Subject: [PATCH] settings_ui: Defer `fetch_files` to avoid reentrant lease of `Project` (#50488) Closes ZED-5CA Release Notes: - Fixed a crash when opening the settings UI. --- 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)); })