1
0
mirror of https://github.com/Kopano-dev/kopano-ol-extension.git synced 2023-10-10 13:37:40 +02:00

Fixes to small store init issues

This commit is contained in:
Patrick Simpson 2017-02-15 11:53:56 +01:00
parent 66601246b1
commit 16f791818f
2 changed files with 8 additions and 4 deletions

View File

@ -160,11 +160,14 @@ namespace Acacia.Stubs.OutlookWrappers
foreach (KeyValuePair<string, AccountWrapper> remove in removed)
{
Logger.Instance.Debug(this, "Account removed: {0} - {1}", remove.Value, remove.Key);
_accountsBySmtp.Remove(remove.Value.SmtpAddress);
_accountsByStoreId.Remove(remove.Key);
if (remove.Value != null)
{
_accountsBySmtp.Remove(remove.Value.SmtpAddress);
OnAccountRemoved(remove.Value);
}
}
}
catch (System.Exception e)
{
Logger.Instance.Error(this, "Exception in CheckAccountsRemoved: {0}", e);

View File

@ -21,6 +21,7 @@ using Acacia.Utils;
using Acacia.ZPush.Connect;
using Microsoft.Win32;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -227,7 +228,7 @@ namespace Acacia.ZPush
}
}
private readonly Dictionary<FolderRegistration, FolderWatcher> _folderWatchers = new Dictionary<FolderRegistration, FolderWatcher>();
private readonly ConcurrentDictionary<FolderRegistration, FolderWatcher> _folderWatchers = new ConcurrentDictionary<FolderRegistration, FolderWatcher>();
private ZPushFolder _rootFolder;
private void HandleFolderWatchers(ZPushAccount account)
@ -245,7 +246,7 @@ namespace Acacia.ZPush
if (!_folderWatchers.TryGetValue(folder, out watcher))
{
watcher = new FolderWatcher();
_folderWatchers.Add(folder, watcher);
_folderWatchers.TryAdd(folder, watcher);
}
watcher.Discovered += handler;