week reference in C# code example
Example: 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);