private void ClearTimer()
{
try
{
lock (_timerLock)
{
if (_mainTimer != null)
{
_mainTimer.Change(Timeout.Infinite, Timeout.Infinite);
_mainTimer.Dispose();
_mainTimer = null;
}
}
}
catch (Exception ex)
{
LogProvider.ErrorFormat("Timer could not be cleared for task '{0}'", ex, Name);
}
}