From c76ffce3ab95471c461e0486cf497f83652f5d5e Mon Sep 17 00:00:00 2001 From: clowwindy Date: Sat, 8 Nov 2014 21:51:08 +0800 Subject: [PATCH] catch exception when trying to kill polipo --- shadowsocks-csharp/Controller/PolipoRunner.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/shadowsocks-csharp/Controller/PolipoRunner.cs b/shadowsocks-csharp/Controller/PolipoRunner.cs index 48ee3471..1f9802cf 100755 --- a/shadowsocks-csharp/Controller/PolipoRunner.cs +++ b/shadowsocks-csharp/Controller/PolipoRunner.cs @@ -20,8 +20,15 @@ namespace Shadowsocks.Controller Process[] existingPolipo = Process.GetProcessesByName("ss_polipo"); foreach (Process p in existingPolipo) { - p.Kill(); - p.WaitForExit(); + try + { + p.Kill(); + p.WaitForExit(); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } } string temppath = Path.GetTempPath(); string polipoConfig = Resources.polipo_config;