v3/process (Win): fix Kill() DuplicateHandle error

pull/1130/head
sunshineplan 4 years ago
parent f8cc3bd072
commit 785e379e67

@ -650,7 +650,10 @@ func (p *Process) TerminateWithContext(ctx context.Context) error {
} }
func (p *Process) KillWithContext(ctx context.Context) error { func (p *Process) KillWithContext(ctx context.Context) error {
process := os.Process{Pid: int(p.Pid)} process, err := os.FindProcess(int(p.Pid))
if err != nil {
return err
}
return process.Kill() return process.Kill()
} }

Loading…
Cancel
Save