Browse Source

Force reclaiming decompilation memory.

pull/19/head
Eusebiu Marcu 14 years ago committed by Daniel Grunwald
parent
commit
3963965559
  1. 5
      src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerDecompilerService.cs
  2. 8
      src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs

5
src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerDecompilerService.cs

@ -25,7 +25,10 @@ namespace ICSharpCode.ILSpyAddIn @@ -25,7 +25,10 @@ namespace ICSharpCode.ILSpyAddIn
static DebuggerDecompilerService()
{
DebugInformation = new ConcurrentDictionary<int, DecompileInformation>();
ProjectService.SolutionClosed += delegate { DebugInformation.Clear(); };
ProjectService.SolutionClosed += delegate {
DebugInformation.Clear();
GC.Collect();
};
}
internal static IDebuggerDecompilerService Instance { get; private set; }

8
src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs

@ -95,9 +95,11 @@ namespace ICSharpCode.ILSpyAddIn @@ -95,9 +95,11 @@ namespace ICSharpCode.ILSpyAddIn
codeView.Dispose();
BookmarkManager.Added -= BookmarkManager_Added;
BookmarkManager.Removed -= BookmarkManager_Removed;
DecompileInformation data;
DebuggerDecompilerService.DebugInformation.TryRemove(decompiledType.MetadataToken.ToInt32(), out data);
data = null;
if (decompiledType != null) {
DecompileInformation data;
DebuggerDecompilerService.DebugInformation.TryRemove(decompiledType.MetadataToken.ToInt32(), out data);
data = null;
}
base.Dispose();
}
#endregion

Loading…
Cancel
Save