The Advanced Memory Management session at Evolve really opened my eyes. I have tried to use WeakReference<T>
in my code:
public WeakReference <MyParentClass> parent;
but get an error "The non-generic type `System.WeakReference' cannot be used with the type arguments".
What am I doing wrong?
Have to add, this code does not generate the error:
public WeakReference parent;
but then I can't access any of the MyParentClass
methods/properties.
Can anyone help me? Struggling to find any documentation on WeakReference
.