Two memory-management functions are available for avoiding memory leaks, which are possible if your users are accessing a Rich UI application by way of Microsoft™ Internet Explorer version 8 or less. The leaks slow your application and can cause the browser to crash.
The issue arises primarily if you declare a widget or embedded handler within a function. These in-function declarations allocate memory at run time, but even after the function ends, Internet Explorer returns the memory to the operating system only after the user has closed the browser tab.
Each of the memory-management functions requests that Internet Explorer return memory. Internet Explorer typically fulfills the request after a delay, but while the application is still running.
The functions are as follows:
Neither function returns a value.
Function myProvider (widget any in) returns(Box) return (new Box {children = [new Button{text = "Memory leak"}]}); end
In this example, the tooltip provider creates a box that cannot be referenced from outside the function, and the box itself includes an anonymous widget. The inability to reference the box means that you cannot pass the box or its anonymous child to a memory-management function.
myBox Box{}; Function myProvider (widget any in) returns(Box) myBox.children = [ new Button{text = "Problem solved"} ]; return(myBox); end
UtilLib.destroyWidgetChildren(myBox);