[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_pushuserdata missing?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 7 Oct 2010 13:06:03 -0300
> int foo_setA( lua_State *L ) {
> Foo **d = (Foo**) luaL_checkudata( L, 1, "Foo" );
> (*f)->setA( luaL_checkint( L, 2 ) );
> lua_pushvalue( L, 1 ); // lua_pushuserdata missing?
> return 1;
> }
>
> Is this usage save?
It's completely safe. If you are in doubt, use
lua_settop(L,1);
instead of lua_pushvalue.
> I hope it is still the same userdata object from the Lua perspective.
It is.