Answers for "c# week refrences"

C#
0

c# week refrences

WeakReference foo = new WeakReference(new Foo());

((Foo)brokerRef.Target).Bar();
((Foo)brokerRef.Target).Baz();
GC.Collect();
GC.WaitForPendingFinalizers();

Assert.IsFalse(foo.IsAlive);
Posted by: Guest on August-10-2020

C# Answers by Framework

Browse Popular Code Answers by Language