I read Silverlight UI not unsubscribing from PropertyChanged events just now. It was exactly the question I'm having. I tried the experiment proposed by in the answer. And the answer is correct, they are collected upon explicit GC.
However, This result in two more questions:
- This seems to be contradicting to these two threads on stackoverflow about Event Handler and GC: 1, 2. Are they wrong?
- How is this implemented? I recall there's something called weak reference in Java. Is it something related?
Here is some clarification of the question:
The eligibity to GC only when publisher cease to exist is common sense. But that common sense contradicts with the experiment in the answer of Silverlight UI not unsubscribing from PropertyChanged events, which proves Silverlight UI's subscription to PropertyChanged events cease to exist if and only if garbage collection happens. I believe more in facts than common sense. But how could that fact be explained? weakref?