[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Life cycle question...
- From: "Brett Bibby" <research@...>
- Date: Thu, 12 Feb 2004 07:51:44 +0800
> Once you load it, running << chunk = loadfile("filename") >>, Lua
> creates a new function that represents the chunk. Once you call
> that function, running << chunk() >>, it creates two new global
> variables, "a" and "b". If you set "a", "b", and "chunk" to nil (or any
> other value), the three functions are now garbage and are eventually
> collected.
Are you saying that the chunk name I pass in the function lua_load becomes a strong reference to the functions it contains? Does it mean I have to set the loaded chunk name to nil?
Brett