| 1582 | } |
| 1583 | |
| 1584 | void Unref(lua_State* L, int table, int reference) |
| 1585 | { |
| 1586 | if (reference == LUA_NOREF) |
| 1587 | { |
| 1588 | return; |
| 1589 | } |
| 1590 | if (g_LuaReferenceCount <= 0) |
| 1591 | { |
| 1592 | dmLogError("Unbalanced number of Lua refs - possibly double calls to dmScript::Unref"); |
| 1593 | } |
| 1594 | --g_LuaReferenceCount; |
| 1595 | luaL_unref(L, table, reference); |
| 1596 | } |
| 1597 | |
| 1598 | int GetLuaRefCount() |
| 1599 | { |