try again to fix weak ref
This commit is contained in:
Родитель
9a9a8ee831
Коммит
15bb707e00
|
@ -117,12 +117,12 @@ namespace ICSharpCode.AvalonEdit
|
|||
|
||||
static void GarbageCollect()
|
||||
{
|
||||
for (int i = 0; i < 5; i++) {
|
||||
for (int i = 0; i < 15; i++) {
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
|
||||
// pump WPF messages so that WeakEventManager can unregister
|
||||
Thread.Sleep(5);
|
||||
Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Background, new Action(delegate {}));
|
||||
Thread.Yield();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче