Browse Source

don't restart timer if disposed

Luke Pulverenti 8 years ago
parent
commit
6f20a8ca05
1 changed files with 7 additions and 0 deletions
  1. 7 0
      MediaBrowser.Server.Implementations/IO/FileRefresher.cs

+ 7 - 0
MediaBrowser.Server.Implementations/IO/FileRefresher.cs

@@ -61,6 +61,11 @@ namespace MediaBrowser.Server.Implementations.IO
 
 
         public void RestartTimer()
         public void RestartTimer()
         {
         {
+            if (_disposed)
+            {
+                return;
+            }
+
             lock (_timerLock)
             lock (_timerLock)
             {
             {
                 if (_timer == null)
                 if (_timer == null)
@@ -281,8 +286,10 @@ namespace MediaBrowser.Server.Implementations.IO
             }
             }
         }
         }
 
 
+        private bool _disposed;
         public void Dispose()
         public void Dispose()
         {
         {
+            _disposed = true;
             DisposeTimer();
             DisposeTimer();
         }
         }
     }
     }