Don't forget you're using an "interpreted" scripting language. Your array of windows probably pales in comparison to other overheads.To me a memory leak is allocating memory and not freeing it when done using it.
Afaik, it's the only "one liner" to that effect.Lexikos, so preferred, practical, "one liner" to empty object before reuse is this:
obj := {}
.
If obj contained the only reference to the object, yes. Otherwise, no. Some other variable or object may contain a reference to the original object, in which case assigning just obj would cause inconsistency.... practically, it has the same effect as emptying old object. Am I right?