Jemt / Fit.UI

Fit.UI is a JavaScript based UI framework built on Object Oriented principles
http://fitui.org
GNU Lesser General Public License v3.0
19 stars 7 forks source link

3 event handlers leaking memory: ContextMenu (used by TreeView) and DragDrop (used by DropDown) #172

Open Jemt opened 1 year ago

Jemt commented 1 year ago

The following regular expression search reveals that anonymous global event handlers are registered without the possibility to unregister them since the returned event ID is not stored and therefore not used to unregister.

(^| )Fit\.Events\.AddHandler\((document|window).*function\(

image

The matches in Core/Events.js are okay - these are event handlers supposed to remain in effect at all times. But the event handler in ContextMenu.js and the two event handlers in DragDrop.js are never removed and therefore leaking memory. ContextMenu is used in TreeView and DragDrop is used in DropDown (which may also use Treeview), so using any of these may cause memory to leak as well.

Also see #155 (Events: Memory leak for event handlers)