If I have the following code:
MyClass pClass = new MyClass(); pClass.MyEvent += MyFunction; pClass = null;
Will pClass be garbage collected
pClass will be garbage collected. However, if the code snippet above is inside another class, the instance of that class might not be cleared if you do not set pClass to null.
pClass
null