Don't capture Workspace handle in defer when rendering Dock

GPUI already provides a mutable reference to the `Workspace` in the
`defer` callback.
This commit is contained in:
Antonio Scandurra 2023-04-18 17:41:35 +02:00
parent 136e599051
commit eee39b4c5c

View file

@ -362,13 +362,8 @@ impl Dock {
); );
let size = resizable.current_size(); let size = resizable.current_size();
let workspace = cx.handle().downgrade(); cx.defer(move |workspace, _| {
cx.defer(move |_, cx| { workspace.dock.panel_sizes.insert(anchor, size);
if let Some(workspace) = workspace.upgrade(cx) {
workspace.update(cx, |workspace, _| {
workspace.dock.panel_sizes.insert(anchor, size);
})
}
}); });
if anchor == DockAnchor::Right { if anchor == DockAnchor::Right {