mirror of https://github.com/axmolengine/axmol.git
* check metatable not found
This commit is contained in:
parent
aa0251bcef
commit
7ecd0d2fab
|
@ -56,6 +56,10 @@ TOLUA_API void tolua_pushusertype (lua_State* L, void* value, const char* type)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
luaL_getmetatable(L, type); /* stack: mt */
|
luaL_getmetatable(L, type); /* stack: mt */
|
||||||
|
if (lua_isnil(L, -1)) { /* NOT FOUND metatable */
|
||||||
|
lua_pop(L, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
lua_pushstring(L,"tolua_ubox");
|
lua_pushstring(L,"tolua_ubox");
|
||||||
lua_rawget(L,-2); /* stack: mt ubox */
|
lua_rawget(L,-2); /* stack: mt ubox */
|
||||||
if (lua_isnil(L, -1)) {
|
if (lua_isnil(L, -1)) {
|
||||||
|
|
Loading…
Reference in New Issue