service/dap: fix race in no debug test (#2766)
Check for a possible output event when disconnecting from a process that has already exited. Fixes #2763
This commit is contained in:
parent
fcc9561cbe
commit
5842c1fe9e
@ -1048,9 +1048,9 @@ func (s *Session) onLaunchRequest(request *dap.LaunchRequest) {
|
||||
if err := cmd.Wait(); err != nil {
|
||||
s.config.log.Debugf("program exited with error: %v", err)
|
||||
}
|
||||
close(s.noDebugProcess.exited)
|
||||
s.logToConsole(proc.ErrProcessExited{Pid: cmd.ProcessState.Pid(), Status: cmd.ProcessState.ExitCode()}.Error())
|
||||
s.send(&dap.TerminatedEvent{Event: *newEvent("terminated")})
|
||||
close(s.noDebugProcess.exited)
|
||||
}()
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user