Implement WindowContext::remove_window
This commit is contained in:
parent
089bf58934
commit
c1ca7ad41d
3 changed files with 15 additions and 6 deletions
|
@ -789,10 +789,13 @@ impl Context for AppContext {
|
|||
|
||||
let root_view = window.root_view.clone().unwrap();
|
||||
let result = update(root_view, &mut WindowContext::new(cx, &mut window));
|
||||
cx.windows
|
||||
.get_mut(handle.id)
|
||||
.ok_or_else(|| anyhow!("window not found"))?
|
||||
.replace(window);
|
||||
|
||||
if !window.removed {
|
||||
cx.windows
|
||||
.get_mut(handle.id)
|
||||
.ok_or_else(|| anyhow!("window not found"))?
|
||||
.replace(window);
|
||||
}
|
||||
|
||||
Ok(result)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue