Reference question

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Reference question

Ivaylo Beltchev
Hi

I have a C-side code that keeps references to Lua values in the registry. Now I need to change the value. Is it acceptable to directly substitute the value in the registry table like this:

lua_rawseti(L,LUA_REGISTRYINDEX,myref);


If not, I have to do something like:

lua_unref(L,myref);
myref=lua_ref(L,TRUE);

which will probably produce a different reference index. I have the index stored in multiple places, so updating all of them to the new index can be a pain.

Thanks
Ivo