In general, once something no longer has a reference to it the garbage collection should clean it out on its next run. That's the main difference between languages ike Lua, Java, and Ruby and those like C. You essentially exchange some temporary bloat for not having to specifically free up the memory you're using. The interpretor occasionally goes through, notes all the reachable objects (those with references(variables) assigned to them) and sweeps away the rest.
also, yeah... your small table of strings is probably not going to tax your RAM any time soon. Especially since Lua will dutifully come behind you and quietly discard the old object for you. =)
Capture a whole block of text
Re: Capture a whole block of text
Ok cool..I dont know a lot about garbage collection so that helps.
I ended up actually using that code in a few places so I turned it into a function and took your advice and got rid of the iterator to wipe out the table.
I set up a global variable script so you wont see where i initialize the vars for this, but this is the scrip file.
I occasionally get a little garbage, but I think maybe it's either from not clearing the window first (which i cant make work) or just from the way the actual MUD lags and occasionally displays things wrong.
I ended up actually using that code in a few places so I turned it into a function and took your advice and got rid of the iterator to wipe out the table.
I set up a global variable script so you wont see where i initialize the vars for this, but this is the scrip file.
Seems to work smoother. I also changed the call to work on a trigger...as soon as it sees the first line of the header for whatever i want to display it fires the tempTriggerTimer.
I occasionally get a little garbage, but I think maybe it's either from not clearing the window first (which i cant make work) or just from the way the actual MUD lags and occasionally displays things wrong.