Merge pull request #1562 from jlewin/1.6.0

Include more scope in lock
This commit is contained in:
johnlewin 2016-10-31 13:46:55 -07:00 committed by GitHub
commit dcdf11bfae

View file

@ -238,17 +238,17 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
return;
}
string json = this.ToJson();
var printerInfo = ProfileManager.Instance[this.ID];
if (printerInfo != null)
{
printerInfo.ContentSHA1 = this.ComputeSha1(json);
ProfileManager.Instance.Save();
}
lock (writeLock)
{
string json = this.ToJson();
var printerInfo = ProfileManager.Instance[this.ID];
if (printerInfo != null)
{
printerInfo.ContentSHA1 = this.ComputeSha1(json);
ProfileManager.Instance.Save();
}
File.WriteAllText(DocumentPath, json);
}