Drop and terminate debugger

This commit is contained in:
Dmitry Sharshakov 2021-08-21 20:38:03 +03:00
parent 26dee49dc9
commit 6709b4242f
No known key found for this signature in database
GPG key ID: 471FD32E15FD8473
2 changed files with 4 additions and 0 deletions

View file

@ -187,6 +187,9 @@ impl Application {
}
}
Some(payload) = self.editor.debugger_events.next() => {
if self.editor.debugger.is_none() {
continue;
}
let mut debugger = self.editor.debugger.as_mut().unwrap();
match payload {
Payload::Event(ev) => {

View file

@ -4329,5 +4329,6 @@ fn dap_terminate(cx: &mut Context) {
if let Some(debugger) = &mut cx.editor.debugger {
let request = debugger.disconnect();
let _ = block_on(request).unwrap();
cx.editor.debugger = None;
}
}