Home › Forums › Development › What is the difference between SequenceListener and WeakSequenceListener? › Reply To: What is the difference between SequenceListener and WeakSequenceListener?

#76361

Hi Frederic,

Indeed when you want to have change from the viewer (Z / T position change for instance) then you need to listen the Viewer then. About Weak vs no Weak, it’s a java thing 🙂 Using a WeakListener mean that the listener won’t be retained by the object you are listening (it uses a WeakReference to the listener and automatically remove it when the reference become null). It may be useful when you want to add a listener to an object that you won’t be able to remove later (the listener), avoiding retaining your listener (and attached object) in memory.

Best,

– Stephane