moved wait to finally block

This commit is contained in:
Greg Lutz
2015-06-25 07:32:11 -04:00
parent 7d43c2cb67
commit 2c9d998794

View File

@@ -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)
{
}
}
}
}
}