int LuaTable::releaseRef() const { if (m_refCount == 1 && hasMeta("__gc")) { // NOT STANDARD! invokeMeta(const_cast<LuaTable*>(this), m_metaTable, "__gc", LuaValue::NIL, LuaValue::NIL); } int r = --m_refCount; if (r == 0) delete this; return r; }
const string HasMeta::getMeta(const string &key) { return hasMeta(key) ? meta[key] : ""; }