Browse Source

Remove md5 lock and just create a new instance everytime

LukePulverenti Luke Pulverenti luke pulverenti 13 years ago
parent
commit
2c56e75ca5
1 changed files with 2 additions and 3 deletions
  1. 2 3
      MediaBrowser.Controller/Kernel.cs

+ 2 - 3
MediaBrowser.Controller/Kernel.cs

@@ -154,12 +154,11 @@ namespace MediaBrowser.Controller
             DirectoryWatchers.Start();
             DirectoryWatchers.Start();
         }
         }
 
 
-        private static MD5CryptoServiceProvider md5Provider = new MD5CryptoServiceProvider();
         public static Guid GetMD5(string str)
         public static Guid GetMD5(string str)
         {
         {
-            lock (md5Provider)
+            using (var provider = new MD5CryptoServiceProvider())
             {
             {
-                return new Guid(md5Provider.ComputeHash(Encoding.Unicode.GetBytes(str)));
+                return new Guid(provider.ComputeHash(Encoding.Unicode.GetBytes(str)));
             }
             }
         }
         }