lua-users home
lua-l archive

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


> 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