Skip to content

Memory Leak when iframe does not inject axe #4746

@straker

Description

@straker

When a page that has an iframe fails to inject axe into the iframe and axe performs an audit, the entire virtual tree is retrained after the run. axe._tree is undefined so axe isn't holding onto the reference itself.

What's happening is that the iframe messaging path holds onto the iframe node when we try to ping the iframe for axe. The sendCommandToFrame function adds a callback for a positive response which uses the iframe node in the callback function. However the callback function is never called, but the closure retains a reference to the node, which also then forces the virtual node associated with the iframe to be retained. Since that virtual node is retained, so is the entire ancestor virtual tree.

The fix would be to somehow remove the closure of the node or cleanup the listener function that gets added when the timeout occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixBug fixesperformancePerformance related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions