Skip to content

Commit

Permalink
Generally kill both parent and their child processes. (dotnet#1232)
Browse files Browse the repository at this point in the history
  • Loading branch information
philliphoff authored Dec 1, 2021
1 parent 311fb03 commit a9a1b83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Microsoft.Tye.Core/ProcessExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static void RunProcessAndWaitForExit(string fileName, string arguments, T
}
else
{
process?.Kill();
process?.Kill(entireProcessTree: true);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Microsoft.Tye.Core/ProcessUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static async Task<ProcessResult> RunAsync(
{
if (!process.CloseMainWindow())
{
process.Kill();
process.Kill(entireProcessTree: true);
}
}

Expand All @@ -177,7 +177,7 @@ public static async Task<ProcessResult> RunAsync(

if (!process.HasExited)
{
process.Kill();
process.Kill(entireProcessTree: true);
}
}
}
Expand All @@ -197,7 +197,7 @@ public static void KillProcess(int pid)
try
{
using var process = Process.GetProcessById(pid);
process?.Kill();
process?.Kill(entireProcessTree: true);
}
catch (ArgumentException) { }
catch (InvalidOperationException) { }
Expand Down

0 comments on commit a9a1b83

Please sign in to comment.