Do we have Lapsed listener problem in java script ?
if we subscribe to an event and then not unsubscribe it will it lead to Lapsed Listener problem.
Do we have Lapsed listener problem in java script ?
if we subscribe to an event and then not unsubscribe it will it lead to Lapsed Listener problem.
Making my comment into an answer since it seemed to have answered the question for you.
If you subscribe to an event on an object, then any code in that event handler is "reachable" and objects referenced in that listener cannot be garbage collected.
That is how Javascript garbage collection is designed. It is not so much a "problem" as it is something you have to learn in order to use Javascript properly. If you're done with a listener and the object you were listening to is still alive (and thus the listener could still be called again), then remove the listener from the host object - the rule is no simpler than that.