Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

Tooltip Memory Leak #6405

@matthias-ccri

Description

@matthias-ccri

I think I've identified the cause of a memory leak in my company's app. The tooltip directive registers a keypress listener on an event, and does not remove it.

element.on('keypress', function(e) {
if (e.which === 27) {
hideTooltipBind();
}
});

This creates a jquery cache entry, which retains the scope through the context.
For all the other listeners registered in prepTriggers(), they are deregistered in unregisterListeners(). Seems to me that the keypress listener should get deregistered too.

Before I go through the trouble of creating a plunkr, would you agree that the leak is obvious enough? The fix would be to make the keypress listener function into a named function, and deregister it at the end of the unregisterListeners function.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions