Include more scope in lock

This commit is contained in:
John Lewin 2016-10-30 11:47:26 -07:00
parent 68d1081e4d
commit 861e8d4f1a

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