[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: One time scripts
- From: RLake@...
- Date: Wed, 22 Oct 2003 13:58:51 -0500
> 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
and
> 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
it,
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.
HTH
Rici.