Re: Life cycle question...
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Life cycle question...
- From: "Brett Bibby" <research@...>
- Date: 2004年2月12日 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