From 33a5d56cf0fbc5184bece28ab1c9088ecf1d29bf Mon Sep 17 00:00:00 2001 From: Jrohy Date: Tue, 18 Jan 2022 17:24:22 +0800 Subject: [PATCH] fix bug --- main.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index f9dc893..4f07358 100644 --- a/main.go +++ b/main.go @@ -117,14 +117,13 @@ func updateProcess(diList []*downloadInfo, stopCh chan struct{}) { if ci.installVersion { if updateCore { exec.Command(fullPath(diList[0].fileFullName), "/S").Run() - } - var checkInfo *cfwInfo - for { - if checkInfo = checkCfw(); checkInfo != nil { - break + for { + if check := checkCfw(); check != nil { + check.process.Kill() + break + } } } - checkInfo.process.Kill() transUpdate(diList, stopCh) } else { transUpdate(diList, stopCh)