fix tolua_fix, cleanup peertable after object deleted

This commit is contained in:
dualface 2013-10-18 11:30:28 +08:00
parent 7d588fbaa3
commit 8f2f524f2d
1 changed files with 5 additions and 1 deletions

View File

@ -128,7 +128,11 @@ TOLUA_API int toluafix_remove_ccobject_by_refid(lua_State* L, int refid)
lua_pop(L, 3);
return -3;
}
// cleanup peertable
lua_pushvalue(L, TOLUA_NOPEER);
lua_setfenv(L, -2);
ud = (void**)lua_touserdata(L, -1);
lua_pop(L, 1); /* stack: mt ubox */
if (ud == NULL)