add disposed check to FileRefresher

This commit is contained in:
Luke Pulverenti 2016-09-17 02:08:38 -04:00
parent b15655a62d
commit 1686443ba6

View File

@ -68,6 +68,11 @@ namespace MediaBrowser.Server.Implementations.IO
lock (_timerLock)
{
if (_disposed)
{
return;
}
if (_timer == null)
{
_timer = new Timer(OnTimerCallback, null, TimeSpan.FromSeconds(ConfigurationManager.Configuration.LibraryMonitorDelay), TimeSpan.FromMilliseconds(-1));
@ -287,6 +292,7 @@ namespace MediaBrowser.Server.Implementations.IO
if (_timer != null)
{
_timer.Dispose();
_timer = null;
}
}
}