Closed oddui closed 8 years ago
Hi @oddui so in this case I think I would argue that this is not a "leak".
The prewarm action in this case is doing exactly what we want, which is "warming" the listener cache - in this case 1 listener, catching the fact that the listener is being added and removed during each run is not something that drool handles directly at this time.
Now this case would be a leak if for instance when you destroyed the menu the listener still stuck around...
Thanks for the issue. I am going to close for now, however we can continue the discussion here if you would like.
Here is a test i added to material-design-lite menu component. It passes with 0 event listener diff.
But if you look at menu.js carefully, the click listener is left on document if menu is closed by clicking a menu item. Lucky that the listener is removed next time the menu is clicked open.
The prewarm process will have a listener left there, each action repeat will heal itself first and then leave a listener. As a result the leak is not detected.
Maybe not really an issue but i think it's good to report.