From 6f20a8ca059f4266082e41b0fd58eae5d0229940 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 10 Aug 2016 23:56:01 -0400 Subject: [PATCH] don't restart timer if disposed --- MediaBrowser.Server.Implementations/IO/FileRefresher.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MediaBrowser.Server.Implementations/IO/FileRefresher.cs b/MediaBrowser.Server.Implementations/IO/FileRefresher.cs index f48beacb5..742585143 100644 --- a/MediaBrowser.Server.Implementations/IO/FileRefresher.cs +++ b/MediaBrowser.Server.Implementations/IO/FileRefresher.cs @@ -61,6 +61,11 @@ namespace MediaBrowser.Server.Implementations.IO public void RestartTimer() { + if (_disposed) + { + return; + } + lock (_timerLock) { if (_timer == null) @@ -281,8 +286,10 @@ namespace MediaBrowser.Server.Implementations.IO } } + private bool _disposed; public void Dispose() { + _disposed = true; DisposeTimer(); } }