Browse Source

Explicitly trigger garbage collection after an assembly was unloaded. Closes #246.

pull/252/merge
Daniel Grunwald 14 years ago
parent
commit
fdb8001b87
  1. 14
      ILSpy/AssemblyList.cs

14
ILSpy/AssemblyList.cs

@ -148,6 +148,20 @@ namespace ICSharpCode.ILSpy @@ -148,6 +148,20 @@ namespace ICSharpCode.ILSpy
lock (assemblies) {
assemblies.Remove(assembly);
}
RequestGC();
}
static bool gcRequested;
void RequestGC()
{
if (gcRequested) return;
gcRequested = true;
App.Current.Dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, new Action(
delegate {
gcRequested = false;
GC.Collect();
}));
}
public void Sort(IComparer<LoadedAssembly> comparer)

Loading…
Cancel
Save