Should I clear up my listeners

As the title, do the listeners I create hang around after the object the listen on is finished with or do I need to call removelistener for each one?
[156 byte] By [liscjda] at [2007-10-3 2:51:48]
# 1
People in the Swing or AWT fora might know more. All i remember that there was a danger of lingering listeners for some reason in some circumstances, so it might not actually be a bad idea to remove them. I don't remember any details, sadly.
CeciNEstPasUnProgrammeura at 2007-7-14 20:40:42 > top of Java-index,Java Essentials,Java Programming...
# 2

> As the title, do the listeners I create hang around after the object the

> listen on is finished with or do I need to call removelistener for each

> one?

You don't have to do anything; if the target of your listeners can be garbage

collected, your listeners will also be garbage collected if nothing else

refers to them. The target refers to the listeners, the listeners don't refer

to the target.

kind regards,

Jos

JosAHa at 2007-7-14 20:40:42 > top of Java-index,Java Essentials,Java Programming...