touch-layer
touch-layer copied to clipboard
Memory leak if DOM node is removed without detaching listeners
Hi @cubiq and @thomasyip,
thank you for your great library. I notice a memory leak if DOM nodes removed from DOM tree. I think this is because eventList holds a reference and node can't be collected by GC:

To call off is, maybe, a proper way to remove listener. But it's not always possible and need to track nodes manually. As I can see, the whole point of eventList is to provide getEvents method. While it can be useful too, developer can track it outside of touch-layer, if needed.