kill process instead of sending SIGTERM on Windows (#3304)

This commit is contained in:
fgsfds authored and GitHub committed 2025-08-04 00:45:50 +02:00
1 parent 73a5722cca
commit a4c4f9efb3
1 file changed
+5
+5
View File
@@ -239,7 +239,12 @@ func (p *process) Stop() error {
if !p.IsRunning() { if !p.IsRunning() {
return errors.New("xray is not running") return errors.New("xray is not running")
} }
if runtime.GOOS == "windows" {
return p.cmd.Process.Kill()
} else {
return p.cmd.Process.Signal(syscall.SIGTERM) return p.cmd.Process.Signal(syscall.SIGTERM)
}
} }
func writeCrashReport(m []byte) error { func writeCrashReport(m []byte) error {