Browse Source

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

fgsfds 2 weeks ago
parent
commit
a4c4f9efb3
1 changed files with 6 additions and 1 deletions
  1. 6 1
      xray/process.go

+ 6 - 1
xray/process.go

@@ -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")
 	}
 	}
-	return p.cmd.Process.Signal(syscall.SIGTERM)
+	
+	if runtime.GOOS == "windows" {
+		return p.cmd.Process.Kill()
+	} else {
+		return p.cmd.Process.Signal(syscall.SIGTERM)
+	}
 }
 }
 
 
 func writeCrashReport(m []byte) error {
 func writeCrashReport(m []byte) error {