Add wait for exit

This commit is contained in:
Connection Refused
2020-05-08 16:41:50 +08:00
parent b83f6d6c3d
commit 9fe2541f18
6 changed files with 12 additions and 2 deletions

View File

@@ -59,6 +59,7 @@ namespace Netch.Controllers
if (Instance != null && !Instance.HasExited)
{
Instance.Kill();
Instance.WaitForExit();
}
}
catch (Exception e)

View File

@@ -73,6 +73,7 @@ namespace Netch.Controllers
if (Instance != null && !Instance.HasExited)
{
Instance.Kill();
Instance.WaitForExit();
}
}
catch (Exception e)

View File

@@ -73,6 +73,7 @@ namespace Netch.Controllers
if (Instance != null && !Instance.HasExited)
{
Instance.Kill();
Instance.WaitForExit();
}
}
catch (Exception)

View File

@@ -117,12 +117,17 @@ namespace Netch.Controllers
{
try
{
if (Global.Settings.BootShadowsocksFromDLL)
{
NativeMethods.Shadowsocks.Stop();
return;
}
if (Instance != null && !Instance.HasExited)
{
Instance.Kill();
Instance.WaitForExit();
}
if (Global.Settings.BootShadowsocksFromDLL)
NativeMethods.Shadowsocks.Stop();
}
catch (Exception e)
{

View File

@@ -106,6 +106,7 @@ namespace Netch.Controllers
if (Instance != null && !Instance.HasExited)
{
Instance.Kill();
Instance.WaitForExit();
}
}
catch (Exception e)

View File

@@ -216,6 +216,7 @@ namespace Netch.Controllers
if (Instance != null && !Instance.HasExited)
{
Instance.Kill();
Instance.WaitForExit();
}
}
catch (Exception e)