lua-users home
lua-l archive

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

hello, 吕游 <>.

On Mon, 13 Aug 2007 14:36:06 +0800
吕游 <> wrote:

> garbage collection, like any Lua object". Problem is:I kept a
> lua_State pointer (for the newly created thread) outside the VM,and I
> have no way to tell VM when i don't need it.if the thread been
> sweeped as garbage,does the pointer i kept still valid? in other
> word,both my code and VM doesn't know when this thread will become
> really useless.
keep this pointer in registry.

> luaL_dofile(T,"test.lua"); after invoke lua_gc, this new thread
> pointer T still valid, and test.lua executed successfully. thanks
this is 'cause you must do 2 gc cycles to sweep the object. add second
call to gc and enjoy the bugs. %-)