Pros and Cons of Listeners as WeakReferences

Viewed 18504

What are the pros and cons of keeping listeners as WeakReferences?

The big 'Pro' of course is that:

Adding a listener as a WeakReference means the listener doesn't need to bother 'removing' itself.

For those worried about the listener having the only reference to the object, why can't there be 2 methods, addListener() and addWeakRefListener()?

Those who don't care about removal can use the latter.

12 Answers
Related