[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: lua_pushobject
- From: "Victor Bombi" <sonoro@...>
- Date: Sun, 23 Feb 2014 16:03:26 +0100
Hello,
May be someone could help me to understand.
I have used lua_pushobject described in
http://lua-users.org/wiki/DoItYourselfCppBinding
I am not able to understand the difference between:
soundFileSt *sndf = (soundFileSt *)lua_newuserdata(L, sizeof(soundFileSt));
luaL_getmetatable(L, "soundFileSt ");
lua_setmetatable(L, -2);
and
soundFileSt *sndf = (soundFileSt *)lua_pushobject(L, soundFileSt)();
They must be different because the first makes my module to crash but not
the second.
Thank you for your attention
victor bombi