Just having a link is not enough to cause a memory leak. Consider the following.
If a stream generates 3 objects (where β denotes a link), A β B β C β A
If A does not refer to a stream, all of them are collected. Circular links are reviewed by GC.
However, this also means that if a delegate contains a reference to an object and the object is still referenced with the delegate, the delegate function will not be cleared.
This will give you the following below.
A - (object with a delegate) B - object containing a reference to the function.
When A falls out of scope, then B will be.
source share