Remove all windows before quitting

This gives all entities a chance of running `Drop::drop` which,
in turn, could cause them to spawn a critical task. For example,
we use this capability when a language server is dropped and we
need to asynchronously send a shutdown message.
This commit is contained in:
Antonio Scandurra 2021-11-02 14:55:31 +01:00
parent 61e06487b7
commit f5aa07aac9
2 changed files with 8 additions and 0 deletions

View file

@ -30,6 +30,7 @@ fn main() {
languages.set_theme(&settings.borrow().theme.editor.syntax);
app.on_quit(|cx| {
cx.remove_all_windows();
let did_finish = cx
.background()
.block_on_critical_tasks(Duration::from_millis(100));