From 668b5a45991568b5323ce410695df5ab3212e368 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Thu, 19 Jul 2018 15:29:29 +0200 Subject: [PATCH] fix a few zombie procs (dub since auto fetch added, git since branch switching added) --- src/ce_dcd.pas | 4 ++++ src/ce_dubproject.pas | 2 ++ src/ce_main.pas | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ce_dcd.pas b/src/ce_dcd.pas index 5c208248..785bd342 100644 --- a/src/ce_dcd.pas +++ b/src/ce_dcd.pas @@ -329,6 +329,7 @@ begin lst := TStringList.Create; try processOutputToStrings(prc,lst); + while prc.Running do ; for str in lst do if AnsiContainsText(str, '127.0.0.1:' + intToStr(prt)) and AnsiContainsText(str, 'TCP') @@ -414,7 +415,10 @@ begin dec(c); end; if c <> folders.Count then + begin fClient.Execute; + while fClient.Running do ; + end; end; procedure TCEDcdWrapper.getCallTip(out tips: string); diff --git a/src/ce_dubproject.pas b/src/ce_dubproject.pas index c33bfb8a..e229c63f 100644 --- a/src/ce_dubproject.pas +++ b/src/ce_dubproject.pas @@ -1406,6 +1406,7 @@ procedure TCEDubProject.updateImportPathsFromJson; Parameters.Add('fetch'); Parameters.Add(n); Execute; + while Running do ; if ExitStatus = 0 then TDubLocalPackages.update(); finally @@ -1450,6 +1451,7 @@ procedure TCEDubProject.updateImportPathsFromJson; Parameters.Add(n); Parameters.Add('--version=' + p); Execute; + while Running do ; if ExitStatus = 0 then begin TDubLocalPackages.update(); diff --git a/src/ce_main.pas b/src/ce_main.pas index 36932827..4a2ed37a 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -4035,8 +4035,7 @@ begin processOutputToStrings(p,r); for i := 0 to r.Count-1 do fMsgs.message(r[i], fProject, amcProj, amkAuto); - while p.Running do - sleep(0); + while p.Running do ; p.Parameters.Clear; p.Parameters.Add('submodule'); p.Parameters.Add('update'); @@ -4044,6 +4043,7 @@ begin p.Parameters.Add('--recursive'); p.Execute; processOutputToStrings(p,r); + while p.Running do ; for i := 0 to r.Count-1 do fMsgs.message(r[i], fProject, amcProj, amkAuto); end; @@ -4076,6 +4076,7 @@ begin p.CurrentDirectory:= fProject.basePath; p.Execute; processOutputToStrings(p,r); + while p.Running do ; for i := 0 to r.Count-1 do fMsgs.message(r[i], fProject, amcProj, amkAuto); end; @@ -4107,6 +4108,7 @@ begin p.CurrentDirectory:= fProject.basePath; p.Execute; processOutputToStrings(p,r); + while p.Running do ; m := TMenuItem.Create(mnuGitBranch); m.action := actProjGitBranchesUpd; mnuGitBranch.Add(m);