Use Safehandle job api

No handle leak
This commit is contained in:
Bruce Wayne
2020-11-14 16:14:59 +08:00
parent 6afc5e5e4d
commit a58f7c7b98
5 changed files with 16 additions and 155 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -33,7 +33,7 @@ namespace Netch.Controllers
{
if (pPrivoxyController.Start(MainController.ServerController.Server, mode))
{
ChildProcessTracker.AddProcess(pPrivoxyController.Instance);
Global.Job.AddProcess(pPrivoxyController.Instance);
}
if (mode.Type == 3) NativeMethods.SetGlobal($"127.0.0.1:{Global.Settings.HTTPLocalPort}", IEProxyExceptions);

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Net;
using System.Threading.Tasks;
@@ -128,7 +128,7 @@ namespace Netch.Controllers
{
if (guard.Instance != null)
{
ChildProcessTracker.AddProcess(guard.Instance);
Global.Job.AddProcess(guard.Instance);
}
}
@@ -170,7 +170,7 @@ namespace Netch.Controllers
{
if (guard.Instance != null)
{
ChildProcessTracker.AddProcess(guard.Instance);
Global.Job.AddProcess(guard.Instance);
}
}