diff --git a/net.nutcore.aliddns/net.nutcore.aliddns/NgrokHelper.cs b/net.nutcore.aliddns/net.nutcore.aliddns/NgrokHelper.cs index cd89611..62fd972 100644 --- a/net.nutcore.aliddns/net.nutcore.aliddns/NgrokHelper.cs +++ b/net.nutcore.aliddns/net.nutcore.aliddns/NgrokHelper.cs @@ -210,13 +210,12 @@ namespace net.nutcore.aliddns try { - Task task = Task.Factory.StartNew(() => + new Thread(() => { var proc = Process.Start(exec); proc.WaitForExit(); proc.Dispose(); - }); - task.Start(); + }).Start(); } catch (Exception ex) { @@ -228,7 +227,7 @@ namespace net.nutcore.aliddns { try { - Task task = Task.Factory.StartNew(() => + new Thread(() => { Process[] pList = Process.GetProcessesByName("Ngrok"); foreach (Process p in pList) @@ -238,8 +237,7 @@ namespace net.nutcore.aliddns p.WaitForExit(); p.Dispose(); } - }); - task.Start(); + }).Start(); } catch (Exception ex) {