3.2.0

reuse of variables and destructors ...

can I reuse a AW variable without creating memory leak or worse ?
var a= new AW.UI.Checkbox; .....; a= new AW.UI.Input; ....

In other words, is there any destructor that I should call before reusing variable "a" ?
Philippe Marzin
March 11,
If you just reuse the variable - the object will not be released from memory. This is because each AW object registers itself in the global array - AW.all. I don't think there is much problem with that unless you create thousands of AW objects. If you really want to remove the AW object from memory you should also clear the reference from AW.all array -

AW.all[obj.getId()] = null;
Alex (ActiveWidgets)
March 11,

This topic is archived.

See also:


Back to support forum