touch-layer icon indicating copy to clipboard operation
touch-layer copied to clipboard

Memory leak if DOM node is removed without detaching listeners

Open Bessonov opened this issue 7 years ago • 0 comments

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:

image

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.

Bessonov avatar Jan 03 '18 17:01 Bessonov