[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: luaL_ref usage
- From: Richter, Jorg <Joerg.Richter@...>
- Date: Thu, 16 Oct 2008 09:15:09 +0200
> g_value_set_int(&gvalue, luaL_ref(priv->L, -1));
Try
lua_pushvalue( L, -1 );
ref = luaL_ref( priv->L, LUA_REGISTRYINDEX );
The t argument of luaL_ref is an index to a table. LUA_REGISTRYINDEX is
just a special index to the registry table. Make sure to read the
documentation for luaL_ref
http://www.lua.org/manual/5.1/manual.html#luaL_ref
And when you try to call your function later:
lua_rawgeti( L, LUA_REGISTRYINDEX, ref );
lua_call( ... )
Jorg