iVis-at-Bilkent / cytoscape.js-context-menus

A Cytoscape.js extension to provide context menu around elements and core instance
MIT License
87 stars 41 forks source link

Fix memory leak connected with eventListener #57

Closed pmierkowski closed 3 years ago

pmierkowski commented 3 years ago

In file cytoscape-context-menus.js in line 99 there is added listener to document element: document.addEventListener('mouseup', onClick) but in the line 189 listener was removed from document.body element document.body.removeEventListener('mouseup', getScratchProp('hideOnNonCyClick')) which cause memory leaks in Angular 10 pomimo despite of use destroy.

ugurdogrusoz commented 3 years ago

@pmierkowski Thanks for your PR. This should be done to the "unstable" branch but perhaps the changes are minor enough for @canbax to do them directly in the "unstable" branch after a review.

pmierkowski commented 3 years ago

@ugurdogrusoz Thanks for the quick reply. If that's a problem, I can do PR to "unstable".

ugurdogrusoz commented 3 years ago

That'd be great, thanks

pmierkowski commented 3 years ago

@ugurdogrusoz Done: https://github.com/iVis-at-Bilkent/cytoscape.js-context-menus/pull/58