diff options
Diffstat (limited to 'win/C#/EncodeQueue/Encode.cs')
-rw-r--r-- | win/C#/EncodeQueue/Encode.cs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/win/C#/EncodeQueue/Encode.cs b/win/C#/EncodeQueue/Encode.cs index 22518bfb2..c0e0b7c3e 100644 --- a/win/C#/EncodeQueue/Encode.cs +++ b/win/C#/EncodeQueue/Encode.cs @@ -86,18 +86,9 @@ namespace Handbrake.EncodeQueue /// </summary>
public void closeCLI(EncodeProcess ep)
{
- Process[] prs = Process.GetProcesses();
- foreach (Process process in prs)
- {
- if (process.Id == ep.processID)
- {
- process.Refresh();
- if (!process.HasExited)
- process.Kill();
-
- process.WaitForExit();
- }
- }
+ Process cli = Process.GetProcessById(ep.processID);
+ if (!cli.HasExited)
+ cli.Kill();
}
/// <summary>
|