Answers for "what is the purpose og a weak reference in c#"

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

Code answers related to "what is the purpose og a weak reference in c#"

C# Answers by Framework

Browse Popular Code Answers by Language