| 1388 | } |
| 1389 | |
| 1390 | void UnrefInInstance(lua_State* L, int ref) |
| 1391 | { |
| 1392 | DM_LUA_STACK_CHECK(L, 0); |
| 1393 | |
| 1394 | GetInstanceContextTable(L); |
| 1395 | // [-1] instance context table or LUA_NIL |
| 1396 | |
| 1397 | if (lua_type(L, -1) != LUA_TTABLE) |
| 1398 | { |
| 1399 | // [-1] LUA_NIL |
| 1400 | |
| 1401 | lua_pop(L, 1); |
| 1402 | return; |
| 1403 | } |
| 1404 | // [-1] instance context table |
| 1405 | |
| 1406 | luaL_unref(L, -1, ref); |
| 1407 | // [-1] instance context table |
| 1408 | |
| 1409 | lua_pop(L, 1); |
| 1410 | } |
| 1411 | |
| 1412 | void ResolveInInstance(lua_State* L, int ref) |
| 1413 | { |