You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fit.UI relies on the browser's Garbage Collector to reclaim memory - we do that by nullifying all variables within a control. But to my surprise this does not guarantee that the browser cleans up event handlers registered on DOM elements. Chrome reports these handlers as detached:
input.onchange=function()// OnKeyUp does not catch changes by mouse (e.g. paste or moving selected text)
Other event handlers within Fit.Controls.Input has also been marked as the cause of retained references.
We need to find all event handlers and make sure they are removed when Dispose() is called.
It works - it has been tested with the following event handlers in the Input control: input.onkeyup, input.onchange, and "paste" on me.GetDomElement().
Perform not only these searches in Fit.UI but also all projects built on Fit.UI.
With every single match we must ensure registered event handlers are removed when a component is disposed.
These lines keep a reference to controls even when disposed, which should be avoided, even though they are internally destroyed. Consider using a string reference instead such as me.GetId().
Fit.UI relies on the browser's Garbage Collector to reclaim memory - we do that by nullifying all variables within a control. But to my surprise this does not guarantee that the browser cleans up event handlers registered on DOM elements. Chrome reports these handlers as detached:
Clicking the highlighted link takes us to:
Fit.UI/Controls/Input/Input.js
Line 111 in 55e08fe
Other event handlers within Fit.Controls.Input has also been marked as the cause of retained references.
We need to find all event handlers and make sure they are removed when Dispose() is called.
It works - it has been tested with the following event handlers in the Input control: input.onkeyup, input.onchange, and "paste" on me.GetDomElement().
Search for (regex): [a-zA-Z0-9].on.+ =
Search for: Fit.Events.AddHandler(
Search for: addEventListener(
Search for: attachEvent(
Perform not only these searches in Fit.UI but also all projects built on Fit.UI.
With every single match we must ensure registered event handlers are removed when a component is disposed.
Also see #155 and #172
The text was updated successfully, but these errors were encountered: