Merge pull request #110 from Cyberboss/KillFix

Fixes the gotcha with Process.Kill()
This commit is contained in:
Jordan Brown
2017-07-05 13:27:07 -04:00
committed by GitHub
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -415,7 +415,10 @@ namespace TGServerService
catch
{
if (!DM.HasExited)
{
DM.Kill();
DM.WaitForExit();
}
throw;
}
finally
+4
View File
@@ -266,7 +266,10 @@ namespace TGServerService
try
{
if (!Properties.Settings.Default.ReattachToDD)
{
Proc.Kill();
Proc.WaitForExit();
}
else
{
Properties.Settings.Default.ReattachPID = Proc.Id;
@@ -402,6 +405,7 @@ namespace TGServerService
if (!Proc.WaitForInputIdle(DDHangStartTime * 1000))
{
Proc.Kill();
Proc.WaitForExit();
Proc.Close();
ShutdownInterop();
currentStatus = TGDreamDaemonStatus.Offline;