fix<Avatar>: fix crash when more than one thread wants to access same avatar file

This commit is contained in:
leo 2021-04-01 10:54:05 +08:00
parent 6f08d03d04
commit c22ea8f4cf
3 changed files with 49 additions and 46 deletions

View file

@ -103,6 +103,9 @@ namespace SourceGit {
Setting = JsonSerializer.Deserialize<Preference>(File.ReadAllText(settingFile));
}
// Make sure avatar cache folder exists
if (!Directory.Exists(Helpers.Avatar.CACHE_PATH)) Directory.CreateDirectory(Helpers.Avatar.CACHE_PATH);
// Try auto configure git via registry.
if (Setting == null || !IsGitConfigured) {
var root = RegistryKey.OpenBaseKey(