update connect

This commit is contained in:
Luke Pulverenti
2014-10-13 16:14:53 -04:00
parent 8a15ee6ab4
commit ab3c26c564
34 changed files with 682 additions and 115 deletions

View File

@@ -310,12 +310,23 @@ namespace MediaBrowser.Server.Implementations.IO
/// <param name="watcher">The watcher.</param>
private void DisposeWatcher(FileSystemWatcher watcher)
{
Logger.Info("Stopping directory watching for path {0}", watcher.Path);
try
{
using (watcher)
{
Logger.Info("Stopping directory watching for path {0}", watcher.Path);
watcher.EnableRaisingEvents = false;
watcher.Dispose();
RemoveWatcherFromList(watcher);
watcher.EnableRaisingEvents = false;
}
}
catch
{
}
finally
{
RemoveWatcherFromList(watcher);
}
}
/// <summary>