lua-users home
lua-l archive

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

> Hmm... I do not quite understand mechanics of such crash... Are you
> saying that coroutine can be collected before objects, created from
> it?

Yes.  You see, a coroutine is just an object itself.  When no
references to it remain, it will be collected sooner or later, just
like any other unreferenced object.

So remember that the gc cannot "see" a lua_State pointer that you
stored somewhere in your C/C++ code, so it is still liable for
collection.  Its a reference to the actual thread object that counts.