From 2c9d998794f21e65321debe3f0ea3388046efd41 Mon Sep 17 00:00:00 2001 From: Greg Lutz Date: Thu, 25 Jun 2015 07:32:11 -0400 Subject: [PATCH] moved wait to finally block --- TimberWinR/Inputs/IISW3CInputListener.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/TimberWinR/Inputs/IISW3CInputListener.cs b/TimberWinR/Inputs/IISW3CInputListener.cs index cbda47d..31c5ca2 100644 --- a/TimberWinR/Inputs/IISW3CInputListener.cs +++ b/TimberWinR/Inputs/IISW3CInputListener.cs @@ -135,8 +135,6 @@ namespace TimberWinR.Inputs rs.close(); GC.Collect(); } - if (!Stop) - syncHandle.Wait(TimeSpan.FromSeconds(_pollingIntervalInSeconds), CancelToken); } catch (OperationCanceledException) { @@ -145,13 +143,18 @@ namespace TimberWinR.Inputs catch (Exception ex) { LogManager.GetCurrentClassLogger().Error(ex); + } + finally + { try { if (!Stop) syncHandle.Wait(TimeSpan.FromSeconds(_pollingIntervalInSeconds), CancelToken); } - catch (Exception) { } - } + catch (Exception) + { + } + } } } }