lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> Unless I am mistake the code to fill Damage will linger.  Actually as I
> write this I just realized that I could put all the code in a function 
> then call the function and finally nil the function.

The code does not "linger". If there is no reference to the code (that is,
you used lua_dofile(), lua_dostring(), or lua_dobuffer() to run it), it
will be garbage collectable once it has returned.

As I recall, there was no way in Lua 4.0 to load a chunk without calling 
but memory grows weak as time passes -- if there were, you could retain
a reference to the code, as you can with Lua 5.0. But the lifetime of the
loaded code is still under your control -- there is nothing to delete.