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

Fit.Loader: Memory leak due to link/script tags remaining in DOM after load #188

Open FlowIT-JIT opened 1 year ago

FlowIT-JIT commented 1 year ago

Consider the following example:

Fit.Loader.LoadScript("path/to/script.js", function(src)
{
    // Do stuff here..
});

The function passed keeps a reference to everything in its closure because LoadScript(..) adds a <script> element to the page which holds a reference to the function for all eternity - or at least until the page is reloaded or closed. The same applies to Fit.Loader.LoadStyleSheet(..).