Skip to content

Memory leak if DOM node is removed without detaching listeners #4

@Bessonov

Description

@Bessonov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions