lua-users home
lua-l archive

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


Greetings,

Let's say I create a udata in the root state of a Lua instance. I then anchor it down by adding a reference to it in the registry of the root state. Later, it gets passed around to other coroutines and all references to it disappear in the root state except the one in the registry. It won't be collected by the root state, but what happens if all references to it disappear in the substate it was passed to? Could it be potentially collected by the substate, regardless that it's still in reference by the registry of the root state?

I haven't yet encountered such a problem, but I've only been able to conduct limited tests, and the Lua src is somewhat hard to follow when you're not used to where everything is.

Olivier Hamel