Remove md5 lock and just create a new instance everytime

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti 2012-08-20 15:24:02 -04:00
parent aae259d2cd
commit 2c56e75ca5

View File

@ -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)));
} }
} }