kill process instead of sending SIGTERM on Windows

This commit is contained in:
fgsfds 2025-08-03 23:02:29 +05:00 committed by GitHub
parent 73a5722cca
commit 2981701fbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -239,8 +239,13 @@ 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 {
crashReportPath := config.GetBinFolderPath() + "/core_crash_" + time.Now().Format("20060102_150405") + ".log" crashReportPath := config.GetBinFolderPath() + "/core_crash_" + time.Now().Format("20060102_150405") + ".log"