diff --git a/TGServerService/Compiler.cs b/TGServerService/Compiler.cs index 63fbe5b8d8..307cc166a2 100644 --- a/TGServerService/Compiler.cs +++ b/TGServerService/Compiler.cs @@ -415,7 +415,10 @@ namespace TGServerService catch { if (!DM.HasExited) + { DM.Kill(); + DM.WaitForExit(); + } throw; } finally diff --git a/TGServerService/DreamDaemon.cs b/TGServerService/DreamDaemon.cs index 9d41b618b7..d523a3548b 100644 --- a/TGServerService/DreamDaemon.cs +++ b/TGServerService/DreamDaemon.cs @@ -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;