mirror of
https://github.com/Kopano-dev/kopano-ol-extension.git
synced 2023-10-10 13:37:40 +02:00
Small fixes, debug tweaks
This commit is contained in:
parent
9f237b76e0
commit
473bba87f6
@ -163,12 +163,8 @@ namespace Acacia.Features.DebugSupport
|
||||
}
|
||||
|
||||
private void GarbageCollect()
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
|
||||
{
|
||||
Util.GarbageCollect();
|
||||
UpdateFields();
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace Acacia.Features.DebugSupport
|
||||
|
||||
public override void AfterStartup()
|
||||
{
|
||||
ShowAbout();
|
||||
//ShowAbout();
|
||||
}
|
||||
|
||||
#region About dialog
|
||||
@ -79,7 +79,9 @@ namespace Acacia.Features.DebugSupport
|
||||
|
||||
public void ShowSettings()
|
||||
{
|
||||
new SettingsDialog().ShowDialog();
|
||||
//new SettingsDialog().ShowDialog();
|
||||
ThisAddIn.Instance.GetFeature<GAB.FeatureGAB>()?.FullResync();
|
||||
Tasks.Task(this, "GC", () => Util.GarbageCollect());
|
||||
}
|
||||
|
||||
public override FeatureSettings GetSettings()
|
||||
|
@ -208,8 +208,6 @@ namespace Acacia.Utils
|
||||
|
||||
#region Implementation
|
||||
|
||||
private readonly HashSet<MailEventHooker> _keepAlives = new HashSet<MailEventHooker>();
|
||||
|
||||
public MailEvents(IAddIn app)
|
||||
{
|
||||
app.ItemLoad += OnItemLoad;
|
||||
@ -221,7 +219,7 @@ namespace Acacia.Utils
|
||||
NSOutlook.ItemEvents_10_Event hasEvents = item as NSOutlook.ItemEvents_10_Event;
|
||||
if (hasEvents != null)
|
||||
{
|
||||
_keepAlives.Add(new MailEventHooker(item, hasEvents, this));
|
||||
new MailEventHooker(item, hasEvents, this);
|
||||
}
|
||||
else ComRelease.Release(item);
|
||||
}
|
||||
@ -248,8 +246,6 @@ namespace Acacia.Utils
|
||||
{
|
||||
Logger.Instance.Debug(this, "DoRelease: {0}", _id);
|
||||
|
||||
_events._keepAlives.Remove(this);
|
||||
|
||||
ComRelease.Release(_item);
|
||||
_item = null;
|
||||
ComRelease.Release(_itemEvents);
|
||||
|
@ -79,5 +79,14 @@ namespace Acacia.Utils
|
||||
}
|
||||
ComRelease.Release(source);
|
||||
}
|
||||
|
||||
public static void GarbageCollect()
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user